File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -97,13 +97,21 @@ runs:
9797 rmdir "${{ steps.setup.outputs.MISE_BACKUP }}"
9898 echo "::endgroup::"
9999
100+ - name : Sanitize workflow name for cache key
101+ id : sanitize_workflow
102+ if : ${{ inputs.cache-npm == 'true' }}
103+ shell : bash
104+ env :
105+ WORKFLOW_NAME : ${{ github.workflow }}
106+ run : echo "workflow_name=${WORKFLOW_NAME// /-}" >> "$GITHUB_OUTPUT"
107+
100108 - name : Cache NPM dependencies
101109 uses : SonarSource/gh-action_cache@v1
102110 if : ${{ inputs.cache-npm == 'true' }}
103111 with :
104112 path : ~/.npm
105- key : npm-${{ runner.os }}-${{ github.workflow }}-${{ hashFiles('**/package-lock.json') }}
106- restore-keys : npm-${{ runner.os }}-${{ github.workflow }}-
113+ key : npm-${{ runner.os }}-${{ steps.sanitize_workflow.outputs.workflow_name }}-${{ hashFiles('**/package-lock.json') }}
114+ restore-keys : npm-${{ runner.os }}-${{ steps.sanitize_workflow.outputs.workflow_name }}-
107115
108116 - name : Check for package.json
109117 id : check_package_json
You can’t perform that action at this time.
0 commit comments