|
| 1 | +# This workflow uses actions that are not certified by GitHub. They are provided |
| 2 | +# by a third-party and are governed by separate terms of service, privacy |
| 3 | +# policy, and support documentation. |
| 4 | + |
| 5 | +name: Scorecard supply-chain security |
| 6 | +on: |
| 7 | + # For Branch-Protection check. Only the default branch is supported. See |
| 8 | + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection |
| 9 | + branch_protection_rule: |
| 10 | + # To guarantee Maintained check is occasionally updated. See |
| 11 | + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained |
| 12 | + workflow_dispatch: |
| 13 | + schedule: |
| 14 | + # At 01:00 on Saturday. |
| 15 | + - cron: '0 1 * * 6' |
| 16 | + push: |
| 17 | + branches: [ "main" ] |
| 18 | + |
| 19 | +# Declare default permissions as read only. |
| 20 | +permissions: read-all |
| 21 | + |
| 22 | +jobs: |
| 23 | + analysis: |
| 24 | + name: Scorecard analysis |
| 25 | + runs-on: ubuntu-latest |
| 26 | + permissions: |
| 27 | + # Needed to upload the results to code-scanning dashboard. |
| 28 | + security-events: write |
| 29 | + # Needed to publish results and get a badge (see publish_results below). |
| 30 | + id-token: write |
| 31 | + |
| 32 | + steps: |
| 33 | + - name: "Checkout code" |
| 34 | + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 |
| 35 | + with: |
| 36 | + persist-credentials: false |
| 37 | + |
| 38 | + - name: "Run analysis" |
| 39 | + uses: ossf/scorecard-action@e38b1902ae4f44df626f11ba0734b14fb91f8f86 # v2.1.2 |
| 40 | + with: |
| 41 | + results_file: results.sarif |
| 42 | + results_format: sarif |
| 43 | + publish_results: true |
| 44 | + |
| 45 | + # Upload the results as artifacts to the repository Actions tab. |
| 46 | + - name: "Upload artifact" |
| 47 | + uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # 4.0.0 |
| 48 | + with: |
| 49 | + name: SARIF file |
| 50 | + path: results.sarif |
| 51 | + retention-days: 5 |
| 52 | + |
| 53 | + # Upload the results to GitHub's code scanning dashboard. |
| 54 | + - name: "Upload to code-scanning" |
| 55 | + uses: github/codeql-action/upload-sarif@17573ee1cc1b9d061760f3a006fc4aac4f944fd5 # v2.2.4 |
| 56 | + with: |
| 57 | + sarif_file: results.sarif |
0 commit comments