From 14e59e228ee044fcfe6ec01e324a5024dd34f711 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 15 Apr 2026 15:42:55 +0200 Subject: [PATCH] fix: Fixed retrieval of cached results --- .github/workflows/code-scan.yml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/code-scan.yml b/.github/workflows/code-scan.yml index 9f62421..60cd53b 100644 --- a/.github/workflows/code-scan.yml +++ b/.github/workflows/code-scan.yml @@ -141,7 +141,6 @@ jobs: run-id: ${{ env.GHA_SECURITY_CODE_SCAN_WORKFLOW_RUN_ID }} github-token: ${{ secrets.GITHUB_TOKEN }} path: "/home/runner/work/${{ github.event.repository.name }}/results" - pattern: dependency-graph_* merge-multiple: true - name: "Upload scan results" @@ -161,14 +160,16 @@ jobs: GITHUB_REPOSITORY_NAME: ${{ github.event.repository.name }} GITHUB_REPOSITORY: ${{ github.repository }} # repository string in format / run: | - shopt -s globstar nullglob - for file in "/home/runner/work/$GITHUB_REPOSITORY_NAME/results"/**/*.json ; do - if [ -d "$file" ] ; then - continue - fi - echo "Uploading cached dependency graph $file" - jq ".sha = \"$GITHUB_SHA\" | .ref = \"$GITHUB_REF\"" < "$file" | gh api "/repos/$GITHUB_REPOSITORY/dependency-graph/snapshots" --method POST --input - || true - done + if [ -d "/home/runner/work/$GITHUB_REPOSITORY_NAME/results" ]; then + shopt -s globstar nullglob + for file in "/home/runner/work/$GITHUB_REPOSITORY_NAME/results"/**/*.json ; do + if [ -d "$file" ] ; then + continue + fi + echo "Uploading cached dependency graph $file" + jq ".sha = \"$GITHUB_SHA\" | .ref = \"$GITHUB_REF\"" < "$file" | gh api "/repos/$GITHUB_REPOSITORY/dependency-graph/snapshots" --method POST --input - || true + done + fi get-repository-metadata: if: ${{ failure() || needs.upload-cached-results.outputs.skip_job_and_continue_scan == 'True' }}