|
| 1 | +# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json |
| 2 | + |
| 3 | +name: Scorecard supply-chain security |
| 4 | +on: |
| 5 | + # For Branch-Protection check. Only the default branch is supported. See |
| 6 | + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection |
| 7 | + branch_protection_rule: |
| 8 | + # To guarantee Maintained check is occasionally updated. See |
| 9 | + # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained |
| 10 | + schedule: |
| 11 | + - cron: '35 6 * * 1' |
| 12 | + push: |
| 13 | + branches: [ "main" ] |
| 14 | + |
| 15 | +# Declare default permissions as read only. |
| 16 | +permissions: read-all |
| 17 | + |
| 18 | +jobs: |
| 19 | + analysis: |
| 20 | + name: Scorecard analysis |
| 21 | + runs-on: ubuntu-latest |
| 22 | + permissions: |
| 23 | + # Needed to upload the results to code-scanning dashboard. |
| 24 | + security-events: write |
| 25 | + # Needed to publish results and get a badge (see publish_results below). |
| 26 | + id-token: write |
| 27 | + |
| 28 | + steps: |
| 29 | + - name: Harden Runner |
| 30 | + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 |
| 31 | + with: |
| 32 | + egress-policy: audit |
| 33 | + |
| 34 | + - name: "Checkout code" |
| 35 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 36 | + with: |
| 37 | + persist-credentials: false |
| 38 | + |
| 39 | + - name: "Run analysis" |
| 40 | + uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0 |
| 41 | + with: |
| 42 | + results_file: results.sarif |
| 43 | + results_format: sarif |
| 44 | + publish_results: true |
| 45 | + |
| 46 | + # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF |
| 47 | + # format to the repository Actions tab. |
| 48 | + - name: "Upload artifact" |
| 49 | + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 |
| 50 | + with: |
| 51 | + name: SARIF file |
| 52 | + path: results.sarif |
| 53 | + retention-days: 5 |
| 54 | + |
| 55 | + # Upload the results to GitHub's code scanning dashboard (optional). |
| 56 | + # Commenting out will disable upload of results to your repo's Code Scanning dashboard |
| 57 | + - name: "Upload to code-scanning" |
| 58 | + uses: github/codeql-action/upload-sarif@f09c1c0a94de965c15400f5634aa42fac8fb8f88 # v3.27.5 |
| 59 | + with: |
| 60 | + sarif_file: results.sarif |
0 commit comments