Run cache cleanup daily and reduce cutoff to 1 day

This commit is contained in:
MHSanaei 2026-04-21 20:36:28 +02:00
parent 15be803da9
commit b86473df02
No known key found for this signature in database
GPG key ID: 7E4060F2FBE5AB7A

View file

@ -1,7 +1,7 @@
name: Cleanup Caches name: Cleanup Caches
on: on:
schedule: schedule:
- cron: '0 3 * * 0' # every Sunday - cron: "0 3 * * *" # every day
workflow_dispatch: workflow_dispatch:
jobs: jobs:
@ -10,11 +10,11 @@ jobs:
permissions: permissions:
actions: write actions: write
steps: steps:
- name: Delete caches older than 3 days - name: Delete caches older than 1 day
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: | run: |
CUTOFF_DATE=$(date -d "3 days ago" -Ins --utc | sed 's/+0000/Z/') CUTOFF_DATE=$(date -d "1 days ago" -Ins --utc | sed 's/+0000/Z/')
echo "Deleting caches older than: $CUTOFF_DATE" echo "Deleting caches older than: $CUTOFF_DATE"
CACHE_IDS=$(gh api --paginate repos/${{ github.repository }}/actions/caches \ CACHE_IDS=$(gh api --paginate repos/${{ github.repository }}/actions/caches \