ci: clear Firefox cache daily (#11802)

This commit is contained in:
Alex Rudenko 2024-02-01 10:33:52 +01:00 committed by GitHub
parent 56a2de04e1
commit fa353d3a59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,9 @@
name: Clear cache name: Clear cache
on: on:
schedule:
# Run everyday at: https://crontab.guru/#0_6_*_*_*.
- cron: '0 6 * * *'
workflow_dispatch: workflow_dispatch:
permissions: permissions:
@ -10,7 +13,7 @@ jobs:
clear-cache: clear-cache:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Clear cache - name: Clear Firefox cache
uses: actions/github-script@v7 uses: actions/github-script@v7
with: with:
script: | script: |
@ -20,12 +23,13 @@ jobs:
repo: context.repo.repo, repo: context.repo.repo,
}) })
for (const cache of caches.data.actions_caches) { for (const cache of caches.data.actions_caches) {
console.log(cache) if (cache.key.toLowerCase().startsWith('firefox')) {
# Dry run console.log(cache)
# github.rest.actions.deleteActionsCacheById({ github.rest.actions.deleteActionsCacheById({
# owner: context.repo.owner, owner: context.repo.owner,
# repo: context.repo.repo, repo: context.repo.repo,
# cache_id: cache.id, cache_id: cache.id,
# }) })
}
} }
console.log("Clear completed") console.log("Clear completed")