File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030 build_and_cache_dependencies_if_needed :
3131 needs : generate_cache_key
3232 runs-on : ubuntu-latest
33- container : mcr.microsoft.com/playwright:v1.57.0-jammy
33+ container : mcr.microsoft.com/playwright:v1.57.0-jammy
34+ permissions :
35+ actions : write
3436 steps :
3537 - uses : actions/checkout@v4
3638 - uses : actions/setup-node@v4
6668 } catch (error) {
6769 core.warning(`Failed to remove ' + labelToRemove + ' label: ${error.message}`);
6870 }
71+ - name : Delete existing cache (to allow re-save on build:clean)
72+ if : steps.node_deps_restore_cache.outputs.cache-hit == 'true' && contains(github.event.pull_request.labels.*.name, 'build:clean')
73+ uses : actions/github-script@v6
74+ with :
75+ script : |
76+ try {
77+ await github.rest.actions.deleteActionsCacheByKey({
78+ owner: context.repo.owner,
79+ repo: context.repo.repo,
80+ key: '${{ needs.generate_cache_key.outputs.cache_key }}'
81+ });
82+ } catch (error) {
83+ core.warning(`Failed to delete cache: ${error.message}`);
84+ }
6985 - uses : actions/cache/save@v4
7086 id : node_deps_save_cache
7187 if : steps.node_deps_restore_cache.outputs.cache-hit != 'true' || contains(github.event.pull_request.labels.*.name, 'build:clean')
You can’t perform that action at this time.
0 commit comments