Action: Clear all GHA caches #75
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Action: Clear all GHA caches" | |
on: | |
workflow_dispatch: | |
inputs: | |
clear_pending_prs: | |
description: Delete caches of pending PR workflows | |
type: boolean | |
default: false | |
clear_develop: | |
description: Delete caches on develop branch | |
type: boolean | |
default: false | |
clear_branches: | |
description: Delete caches on non-develop branches | |
type: boolean | |
default: true | |
schedule: | |
# Run every day at midnight | |
- cron: '0 0 * * *' | |
jobs: | |
clear-caches: | |
name: Delete all caches | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: 'package.json' | |
# TODO: Use cached version if possible (but never store cache) | |
- name: Install dependencies | |
run: yarn install --frozen-lockfile | |
- name: Delete GHA caches | |
uses: ./dev-packages/clear-cache-gh-action | |
with: | |
clear_pending_prs: ${{ inputs.clear_pending_prs }} | |
clear_develop: ${{ inputs.clear_develop }} | |
clear_branches: ${{ inputs.clear_branches }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} |