Skip to content

Commit 4c9c566

Browse files
authored
test cache delete
1 parent 00042be commit 4c9c566

1 file changed

Lines changed: 32 additions & 3 deletions

File tree

.github/workflows/Matrix XP.yml

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,47 @@ jobs:
136136
with:
137137
path: ~/artifacts
138138

139+
- uses: geekyeggo/delete-artifact@v2
140+
with:
141+
name: '*'
142+
143+
# - name: Cleanup
144+
# run: |
145+
# gh extension install actions/gh-actions-cache
146+
147+
# REPO=${{ github.repository }}
148+
# BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
149+
150+
# echo "Fetching list of cache key"
151+
# cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
152+
153+
# ## Setting this to not fail the workflow while deleting cache keys.
154+
# set +e
155+
# echo "Deleting caches..."
156+
# for cacheKey in $cacheKeysForPR
157+
# do
158+
# gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
159+
# done
160+
# echo "Done"
161+
# env:
162+
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
163+
139164
- name: "✔️ list Caches"
140165
run: |
141166
curl \
142167
-H "Accept: application/vnd.github.v3+json" \
143168
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
144169
https://api.github.com/repos/$GITHUB_REPOSITORY/actions/caches
145170
146-
- uses: geekyeggo/delete-artifact@v2
147-
with:
148-
name: '*'
149171
- uses: snnaplab/delete-branch-cache-action@v1
150172

173+
- name: "✔️ list Caches"
174+
run: |
175+
curl \
176+
-H "Accept: application/vnd.github.v3+json" \
177+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
178+
https://api.github.com/repos/$GITHUB_REPOSITORY/actions/caches
179+
151180
- name: "✔️ ls"
152181
run: |
153182
pwd

0 commit comments

Comments
 (0)