blob: 80724463d2e3fb96e4b3d8a0891388e6136c65bd [file] [log] [blame]
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:
vuln-scan:
name: Vulnerability scanning
runs-on: ubuntu-20.04
# run on flutter/engine push to main or PRs with 'vulnerability patch' label
if: ${{ github.repository == 'flutter/engine' && (github.event_name == 'push' || github.event.label.name == 'vulnerability scan') }}
permissions:
# Needed to upload the SARIF results to code-scanning dashboard.
security-events: write
actions: read
contents: read
# Needed to access OIDC token.
id-token: write
steps:
- name: "Checkout code"
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
with:
persist-credentials: false
- name: "setup python"
uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0
with:
python-version: '3.7.7' # install the python version needed
- name: "extract and flatten deps"
run: python ci/deps_parser.py
- name: "scan deps for vulnerabilities"
run: python ci/scan_flattened_deps.py
# Upload the results as artifacts.
- name: "Upload artifact"
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
name: SARIF file
path: osvReport.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to security tab"
uses: github/codeql-action/upload-sarif@0225834cc549ee0ca93cb085b92954821a145866
with:
sarif_file: osvReport.sarif