d33c6c3ef1
Closes https://github.com/dart-lang/sdk/pull/60447 GitOrigin-RevId: bec1bfa2bb331a5c6a2c034afa7f687b22599070 Change-Id: I501fff84a84a8d0df4c6eeab77bff45651b58bb5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/419520 Reviewed-by: Alexander Thomas <athom@google.com>
57 lines
2.0 KiB
YAML
57 lines
2.0 KiB
YAML
name: Third party deps scan
|
|
|
|
on:
|
|
# Only the default branch is supported.
|
|
branch_protection_rule:
|
|
push:
|
|
branches: [ main ]
|
|
pull_request:
|
|
types: [ labeled ]
|
|
|
|
# Declare default permissions as read only.
|
|
permissions: read-all
|
|
|
|
jobs:
|
|
extract-deps:
|
|
name: Extract Dependencies
|
|
runs-on: 'ubuntu-24.04'
|
|
if: ${{ (github.repository == 'dart-lang/sdk' && github.event_name == 'push') || github.event.label.name == 'vulnerability scan' }}
|
|
permissions:
|
|
# Needed to upload the SARIF results to code-scanning dashboard.
|
|
security-events: write
|
|
contents: read
|
|
steps:
|
|
- name: "Checkout code"
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
|
|
with:
|
|
persist-credentials: false
|
|
- name: "setup python"
|
|
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
|
|
with:
|
|
python-version: '3.7.7' # install the python version needed
|
|
- name: "extract deps, find commit hash, pass to osv-scanner"
|
|
run: python .github/extract_deps.py --output osv-lockfile-${{github.sha}}.json
|
|
- name: "upload osv-scanner deps"
|
|
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
|
|
with:
|
|
# use github.ref in name to avoid duplicated artifacts
|
|
name: osv-lockfile-${{github.sha}}
|
|
path: osv-lockfile-${{github.sha}}.json
|
|
retention-days: 2
|
|
vuln-scan:
|
|
name: Vulnerability scanning
|
|
needs:
|
|
extract-deps
|
|
uses: "google/osv-scanner/.github/workflows/osv-scanner-reusable.yml@main"
|
|
with:
|
|
# Download the artifact uploaded in extract-deps step
|
|
download-artifact: osv-lockfile-${{github.sha}}
|
|
scan-args: |-
|
|
--lockfile=osv-scanner:osv-lockfile-${{github.sha}}.json
|
|
fail-on-vuln: false
|
|
# makes sure the osv-formatted vulns are uploaded
|
|
permissions:
|
|
# Needed to upload the SARIF results to code-scanning dashboard.
|
|
security-events: write
|
|
contents: read
|