Repository navigation
ci(deps): bump the codeql group with 3 updates #57
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| # This workflow uses actions that are not certified by GitHub. | |
| # They are provided by a third-party and are governed by | |
| # separate terms of service, privacy policy, and support | |
| # documentation. | |
| # A sample workflow which sets up periodic OSV-Scanner scanning for vulnerabilities, | |
| # in addition to a PR check which fails if new vulnerabilities are introduced. | |
| # | |
| # For more examples and options, including how to ignore specific vulnerabilities, | |
| # see https://google.github.io/osv-scanner/github-action/ | |
| name: "OSV Scanner - PR" | |
| on: | |
| pull_request: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| permissions: {} | |
| jobs: | |
| osv-scanner-pr: | |
| permissions: | |
| # Require writing security events to upload SARIF file to security tab | |
| security-events: write | |
| # Read commit contents | |
| contents: read | |
| # Actions read-only | |
| actions: read | |
| uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@a345acffa64b0eaede81a3d9aae6141214d9c8fc" # v2.6.0 | |
| with: | |
| fail-on-vuln: false | |
| check: | |
| runs-on: ubuntu-latest | |
| needs: osv-scanner-pr | |
| steps: | |
| # The results are read from the uploaded artifacts rather than from the | |
| # reusable workflow's job outputs: a large output passed to a step via | |
| # env (or inline) exceeds the kernel's per-string exec limit and the | |
| # runner fails to start bash with "Argument list too long". | |
| - name: Download OSV scan results | |
| uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| pattern: "*-json-results" | |
| merge-multiple: true | |
| path: ${{ runner.temp }}/osv | |
| - name: Check OSV scan results | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| IFS=$'\n\t' | |
| # Fail if any vulnerability present in the new results is absent from | |
| # the old results, i.e. the PR introduces it. Read via process | |
| # substitution rather than a pipe so the rc assignment is not lost in | |
| # a subshell, and use a fixed-string match for the exact vuln id. | |
| rc=0 | |
| while read -r vid; do | |
| if ! grep -qF -e "\"${vid}\"" "${RUNNER_TEMP}/osv/old-results.json"; then | |
| rc=1 | |
| >&2 echo "error: PR introduces new vulnerability ${vid} (see step 'scan > osv-scanner-pr > Run osv-scanner-reporter' for details)" | |
| fi | |
| done < <(jq -r '.results[]?.packages[]?.vulnerabilities[]?.id' "${RUNNER_TEMP}/osv/new-results.json") | |
| if [ "${rc}" -ne 0 ]; then | |
| exit 1 | |
| fi |