Files
bottom/.github/workflows/clear_workflow_cache.yml
T
Clement Tsang d921527d8b ci: use native ARM runners w/o cross for aarch64-unknown-linux-gnu jobs (#1988)
* ci: don't use cross for aarch64-unknown-linux-gnu

* also use ubuntu-24.04 everywhere

* fix build-deb too

* fix musl too

* yeah we can use native arm for container for deb step for musl

* fix musl issues
2026-02-26 21:59:15 -05:00

46 lines
1.6 KiB
YAML

# Simple job to clear the cache used by a workflow. This automatically runs when a PR is closed/merged
# to clean up the corresponding PR's cache.
name: "clear workflow cache"
on:
workflow_dispatch:
inputs:
id:
description: "Which id to clear. Type main/master/all to clean all, and keep-main/keep-master to clean all but the main branch."
required: false
pull_request:
types:
- closed
schedule:
- cron: "0 11 * * 0"
jobs:
clear-cache:
if: ${{ github.event_name != 'pull_request' || ! github.event.pull_request.head.repo.fork }} # If it is a PR, only if not a fork
runs-on: ubuntu-24.04
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 1
# We run each script twice with a small delay in between to try and catch everything.
- name: Clear cache
run: |
if [[ -n "${{ github.event.schedule }}" ]]; then
python ./scripts/clear_cache.py keep-main
sleep 5
python ./scripts/clear_cache.py keep-main
elif [[ -z "${{ github.event.inputs.id }}" ]]; then
python ./scripts/clear_cache.py ${{ github.event.pull_request.number }}
sleep 5
python ./scripts/clear_cache.py ${{ github.event.pull_request.number }}
else
python ./scripts/clear_cache.py ${{ github.event.inputs.id }}
sleep 5
python ./scripts/clear_cache.py ${{ github.event.inputs.id }}
fi