Skip to content

Commit

Permalink
Merge pull request #628 from weseek/support/remove-github-actions-cac…
Browse files Browse the repository at this point in the history
…he-automatically

support: Remove GitHub actions cache automatically
  • Loading branch information
ryu-sato authored May 3, 2024
2 parents e2cd00f + dae3696 commit 4cb6072
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/misc-remove_cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
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 --json id,createdAt | jq ".[].createdAt |= (sub(\"\\\\..*Z\";\"Z\") | fromdateiso8601 < `expr $(date +%s) - 60 \* 60`)" | jq -r '.[].id');
do gh cache delete $ID;
done

0 comments on commit 4cb6072

Please sign in to comment.