2022-01-27 01:25:45 +00:00
|
|
|
name: Scorecards supply-chain security
|
|
|
|
on:
|
|
|
|
# Only the default branch is supported.
|
|
|
|
branch_protection_rule:
|
|
|
|
push:
|
|
|
|
branches: [ master ]
|
|
|
|
|
|
|
|
# Declare default permissions as read only.
|
|
|
|
permissions: read-all
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
analysis:
|
|
|
|
name: Scorecards analysis
|
|
|
|
runs-on: ubuntu-latest
|
2022-02-01 22:58:27 +00:00
|
|
|
if: ${{ github.repository == 'flutter/flutter' }}
|
2022-01-27 01:25:45 +00:00
|
|
|
permissions:
|
|
|
|
# Needed to upload the results to code-scanning dashboard.
|
|
|
|
security-events: write
|
|
|
|
actions: read
|
|
|
|
contents: read
|
2022-09-13 15:58:05 +00:00
|
|
|
# Needed to access OIDC token.
|
|
|
|
id-token: write
|
2022-01-27 01:25:45 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: "Checkout code"
|
2023-06-10 18:15:04 +00:00
|
|
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
|
2022-01-27 01:25:45 +00:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
|
|
|
|
- name: "Run analysis"
|
2023-06-26 18:42:13 +00:00
|
|
|
uses: ossf/scorecard-action@08b4669551908b1024bb425080c797723083c031
|
2022-01-27 01:25:45 +00:00
|
|
|
with:
|
|
|
|
results_file: results.sarif
|
|
|
|
results_format: sarif
|
|
|
|
# Read-only PAT token. To create it,
|
|
|
|
# follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
|
|
|
|
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
|
|
|
|
# Publish the results to enable scorecard badges. For more details, see
|
|
|
|
# https://github.com/ossf/scorecard-action#publishing-results.
|
|
|
|
# For private repositories, `publish_results` will automatically be set to `false`,
|
|
|
|
# regardless of the value entered here.
|
|
|
|
publish_results: true
|
|
|
|
|
|
|
|
# Upload the results as artifacts (optional).
|
|
|
|
- name: "Upload artifact"
|
2023-01-11 16:53:49 +00:00
|
|
|
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
|
2022-01-27 01:25:45 +00:00
|
|
|
with:
|
|
|
|
name: SARIF file
|
|
|
|
path: results.sarif
|
|
|
|
retention-days: 5
|
|
|
|
|
|
|
|
# Upload the results to GitHub's code scanning dashboard.
|
|
|
|
- name: "Upload to code-scanning"
|
2023-03-27 22:49:35 +00:00
|
|
|
uses: github/codeql-action/upload-sarif@04df1262e6247151b5ac09cd2c303ac36ad3f62b
|
2022-01-27 01:25:45 +00:00
|
|
|
with:
|
|
|
|
sarif_file: results.sarif
|