diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b70720d78..ae50c8d28 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -166,7 +166,7 @@ jobs: - name: "Generate SARIF report from code scanning alerts" uses: mongodb-labs/drivers-github-tools/code-scanning-export@v2 with: - ref: ${{ inputs.version }} + ref: refs/tags/${{ inputs.version }} output-file: ${{ env.S3_ASSETS }}/code-scanning-alerts.json - name: "Generate compliance report" diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index ac2299693..7a634683b 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -34,6 +34,11 @@ jobs: with: ref: ${{ github.event_name == 'workflow_dispatch' && inputs.ref || github.ref }} + - name: "Get SHA hash of checked out ref" + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + echo CHECKED_OUT_SHA=$(git rev-parse HEAD) >> $GITHUB_ENV + - name: "Setup" uses: "./.github/actions/setup" with: @@ -44,6 +49,15 @@ jobs: run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc) --report=psalm.sarif" - name: "Upload SARIF report" + if: ${{ github.event_name != 'workflow_dispatch' }} + uses: "github/codeql-action/upload-sarif@v3" + with: + sarif_file: psalm.sarif + + - name: "Upload SARIF report" + if: ${{ github.event_name == 'workflow_dispatch' }} uses: "github/codeql-action/upload-sarif@v3" with: sarif_file: psalm.sarif + ref: ${{ inputs.ref }} + sha: ${{ env.CHECKED_OUT_SHA }}