Skip to content

Commit 1fc289f

Browse files
author
刘威
committed
ci: fix cache maintenance repo context
1 parent c547a97 commit 1fc289f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

.github/workflows/cache-maintenance.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ jobs:
2323
env:
2424
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2525
KEEP_PER_KEY: ${{ inputs.keep_per_key || '2' }}
26+
REPO: ${{ github.repository }}
2627

2728
steps:
2829
- name: List caches
29-
run: gh cache list --limit 1000 --json createdAt,id,key,lastAccessedAt,ref,sizeInBytes > caches.json
30+
run: gh cache list --repo "$REPO" --limit 1000 --json createdAt,id,key,lastAccessedAt,ref,sizeInBytes > caches.json
3031

3132
- name: Select stale caches
3233
shell: bash
@@ -96,6 +97,6 @@ jobs:
9697
while IFS= read -r cache_id; do
9798
if [ -n "$cache_id" ]; then
9899
echo "Deleting cache $cache_id"
99-
gh cache delete "$cache_id"
100+
gh cache delete "$cache_id" --repo "$REPO"
100101
fi
101102
done < stale-cache-ids.txt

0 commit comments

Comments
 (0)