Skip to content

Commit d6a0895

Browse files
committed
Fix cache immutability by deleting old cache before saving new one
1 parent 0c28913 commit d6a0895

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/verify-tinytex-patterns.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
permissions:
99
contents: read
1010
issues: write
11+
actions: write
1112

1213
jobs:
1314
verify:
@@ -149,6 +150,14 @@ jobs:
149150
cp regex.json .cache/regex.json
150151
echo "✓ Cache updated with new patterns"
151152
153+
- name: Delete old cache
154+
if: steps.compare.outputs.changed == 'true'
155+
continue-on-error: true
156+
env:
157+
GH_TOKEN: ${{ github.token }}
158+
run: |
159+
gh cache delete tinytex-regex-latest || echo "No existing cache to delete"
160+
152161
- name: Save new cache
153162
if: steps.compare.outputs.changed == 'true' || steps.compare.outputs.first_run == 'true'
154163
uses: actions/cache/save@v4

0 commit comments

Comments
 (0)