Misc - Remove cache #172
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: Misc - Remove cache | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: | |
- Application - Test | |
types: | |
- completed | |
jobs: | |
misc-remove_cache: | |
runs-on: ubuntu-latest | |
steps: | |
# remove cache older than 1 hour ago | |
- run: | |
for ID in $(gh cache list --repo ${{ github.repository }} --json id,createdAt | jq ".[].createdAt |= (sub(\"\\\\..*Z\";\"Z\") | fromdateiso8601 < `expr $(date +%s) - 60 \* 60`)" | jq -r '.[].id'); | |
do gh cache delete --repo ${{ github.repository }} $ID; | |
done | |
env: | |
GH_TOKEN: ${{ github.token }} |