Skip to content

ci: keep accepted Scorecard residuals out of code scanning #19

ci: keep accepted Scorecard residuals out of code scanning

ci: keep accepted Scorecard residuals out of code scanning #19

Workflow file for this run

name: security-deps
on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
- cron: '23 6 * * 1'
concurrency:
group: security-deps-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: read
jobs:
scan:
name: dep vuln scan (osv + audit)
runs-on: ubuntu-24.04
timeout-minutes: 10
permissions:
contents: read
security-events: write
env:
OSV_SCANNER_VERSION: '2.3.8'
OSV_SCANNER_SHA256: 'bc98e15319ed0d515e3f9235287ba53cdc5535d576d24fd573978ecfe9ab92dc'
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install osv-scanner CLI
run: |
set -euo pipefail
curl -sSL -o /tmp/osv-scanner \
"https://github.com/google/osv-scanner/releases/download/v${OSV_SCANNER_VERSION}/osv-scanner_linux_amd64"
echo "${OSV_SCANNER_SHA256} /tmp/osv-scanner" | sha256sum -c -
chmod +x /tmp/osv-scanner
sudo mv /tmp/osv-scanner /usr/local/bin/
osv-scanner --version
- name: Run osv-scanner
run: |
set +e
osv-scanner \
--config=osv-scanner.toml \
--lockfile=bun.lock \
--format=sarif \
--output-file=osv-results.sarif
echo "OSV_EXIT=$?" >> "$GITHUB_ENV"
set -e
- name: Upload osv SARIF
if: always()
uses: github/codeql-action/upload-sarif@db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28 # v4.37.8
with:
sarif_file: osv-results.sarif
category: osv-scanner
continue-on-error: true
- name: Fail on osv findings
run: |
if [ ! -f osv-results.sarif ]; then
echo "osv-results.sarif missing: osv-scanner failed to write output."
exit 1
fi
UNFILTERED=$(jq -r '[.runs[].results[]?] | length' osv-results.sarif)
echo "Unfiltered osv-scanner findings: ${UNFILTERED}"
if [ "${UNFILTERED}" != "0" ]; then
echo "osv-scanner reported ${UNFILTERED} unfiltered vulnerabilities. See SARIF in the Security tab."
exit 1
fi
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.3.14
- name: bun audit
run: bash scripts/ci/bun-audit.sh