File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9797
9898 steps :
9999 - name : Restore cached git repository
100- uses : buildjet /cache@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
100+ uses : actions /cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
101101 with :
102102 path : .git
103103 key : git-repo
Original file line number Diff line number Diff line change 8585 TESTING=true npm run build --if-present
8686
8787 - name : Save context
88- uses : buildjet /cache/save@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
88+ uses : actions /cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
8989 with :
9090 key : cypress-context-${{ github.run_id }}
9191 path : ./
@@ -153,7 +153,8 @@ jobs:
153153
154154 steps :
155155 - name : Restore context
156- uses : buildjet/cache/restore@3e70d19e31d6a8030aeddf6ed8dbe601f94d09f4 # v4.0.2
156+ id : cache
157+ uses : actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
157158 with :
158159 fail-on-cache-miss : true
159160 key : cypress-context-${{ github.run_id }}
@@ -232,6 +233,23 @@ jobs:
232233
233234 name : cypress-summary
234235
236+ permissions :
237+ # `actions:write` permission is required to delete caches
238+ # See also: https://docs.github.com/en/rest/actions/cache?apiVersion=2022-11-28#delete-a-github-actions-cache-for-a-repository-using-a-cache-id
239+ actions : write
240+ contents : read
241+
235242 steps :
236243 - name : Summary status
237244 run : if ${{ needs.init.result != 'success' || ( needs.cypress.result != 'success' && needs.cypress.result != 'skipped' ) }}; then exit 1; fi
245+
246+ - name : Delete cache on success
247+ run : |
248+ ## Setting this to not fail the workflow while deleting cache keys.
249+ set +e
250+ echo "Deleting cache..."
251+ gh cache delete 'cypress-context-${{ github.run_id }}'
252+ echo "Done"
253+ env :
254+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
255+ GH_REPO : ${{ github.repository }}
You can’t perform that action at this time.
0 commit comments