@@ -13,8 +13,8 @@ inputs:
1313 description : " Personal access token (PAT) with fine-grained permissions 'contents: write', 'issues: write', and 'pull_requests: write'"
1414 required : true
1515 cache_key :
16- description : " Custom key for caching findings across runs"
17- required : false
16+ description : " Key for caching findings across runs"
17+ required : true
1818 login_url :
1919 description : " If scanned pages require authentication, the URL of the login page"
2020 required : false
@@ -35,21 +35,11 @@ inputs:
3535runs :
3636 using : " composite"
3737 steps :
38- - name : Generate cache key
39- id : cache_key
40- shell : bash
41- run : |
42- CACHE_KEY="${{ inputs.cache_key }}"
43- if [[ -z "$CACHE_KEY" ]]; then
44- # If cache_key is not provided, generate a default one using the branch name, replacing characters (e.g. `/`) which would create unexpected paths.
45- CACHE_KEY=$(printf 'cached_findings-%s' "${{ github.ref_name }}" | tr -cs 'A-Za-z0-9._-' '_')
46- fi
47- echo "cache_key=$CACHE_KEY" >> $GITHUB_OUTPUT
4838 - name : Restore cached_findings
4939 id : restore
5040 uses : ./.github/actions/gh-cache/cache
5141 with :
52- key : ${{ steps.cache_key.outputs .cache_key }}
42+ key : ${{ inputs .cache_key }}
5343 token : ${{ inputs.token }}
5444 - if : ${{ inputs.login_url && inputs.username && inputs.password && !inputs.auth_context }}
5545 name : Authenticate
8474 - name : Save cached_findings
8575 uses : ./.github/actions/gh-cache/cache
8676 with :
87- key : ${{ steps.cache_key.outputs .cache_key }}
77+ key : ${{ inputs .cache_key }}
8878 value : ${{ steps.file.outputs.findings }}
8979 token : ${{ inputs.token }}
9080
0 commit comments