| 1 |
name: Scorecards supply-chain security |
| 2 |
on: |
| 3 |
# Only the default branch is supported. |
| 4 |
branch_protection_rule: |
| 5 |
schedule: |
| 6 |
- cron: '44 9 * * 4' |
| 7 |
push: |
| 8 |
branches: [ "main" ] |
| 9 |
|
| 10 |
jobs: |
| 11 |
analysis: |
| 12 |
name: Scorecards analysis |
| 13 |
runs-on: ubuntu-latest |
| 14 |
permissions: |
| 15 |
# Needed to upload the results to code-scanning dashboard. |
| 16 |
security-events: write |
| 17 |
# Used to receive a badge. |
| 18 |
id-token: write |
| 19 |
# read permissions to all the other objects |
| 20 |
actions: read |
| 21 |
attestations: read |
| 22 |
checks: read |
| 23 |
contents: read |
| 24 |
deployments: read |
| 25 |
issues: read |
| 26 |
discussions: read |
| 27 |
packages: read |
| 28 |
pages: read |
| 29 |
pull-requests: read |
| 30 |
statuses: read |
| 31 |
|
| 32 |
steps: |
| 33 |
- name: "Checkout code" |
| 34 |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag=v4.4.2 |
| 35 |
with: |
| 36 |
persist-credentials: false |
| 37 |
|
| 38 |
- name: "Run analysis" |
| 39 |
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # tag=v2.4.0 |
| 40 |
with: |
| 41 |
results_file: results.sarif |
| 42 |
results_format: sarif |
| 43 |
|
| 44 |
# Publish the results for public repositories to enable scorecard badges. For more details, see |
| 45 |
# https://github.com/ossf/scorecard-action#publishing-results. |
| 46 |
# For private repositories, `publish_results` will automatically be set to `false`, regardless |
| 47 |
# of the value entered here. |
| 48 |
publish_results: true |
| 49 |
|
| 50 |
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF |
| 51 |
# format to the repository Actions tab. |
| 52 |
- name: "Upload artifact" |
| 53 |
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # tag=v4.5.0 |
| 54 |
with: |
| 55 |
name: SARIF file |
| 56 |
path: results.sarif |
| 57 |
retention-days: 5 |
| 58 |
|
| 59 |
# Upload the results to GitHub's code scanning dashboard. |
| 60 |
- name: "Upload to code-scanning" |
| 61 |
uses: github/codeql-action/upload-sarif@3096afedf9873361b2b2f65e1445b13272c83eb8 # tag=v2.20.00 |
| 62 |
with: |
| 63 |
sarif_file: results.sarif |