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