| 1 |
name: Scorecard supply-chain security |
| 2 |
on: |
| 3 |
branch_protection_rule: |
| 4 |
schedule: |
| 5 |
- cron: '45 23 * * 0' |
| 6 |
push: |
| 7 |
branches: ["main"] |
| 8 |
|
| 9 |
jobs: |
| 10 |
analysis: |
| 11 |
name: Scorecard analysis |
| 12 |
runs-on: ubuntu-latest |
| 13 |
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request' |
| 14 |
permissions: |
| 15 |
contents: read |
| 16 |
security-events: write |
| 17 |
id-token: write |
| 18 |
|
| 19 |
steps: |
| 20 |
- name: "Checkout code" |
| 21 |
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 22 |
with: |
| 23 |
persist-credentials: false |
| 24 |
|
| 25 |
- name: "Run analysis" |
| 26 |
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 |
| 27 |
with: |
| 28 |
results_file: results.sarif |
| 29 |
results_format: sarif |
| 30 |
|
| 31 |
publish_results: true |
| 32 |
|
| 33 |
- name: "Upload artifact" |
| 34 |
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 |
| 35 |
with: |
| 36 |
name: SARIF file |
| 37 |
path: results.sarif |
| 38 |
retention-days: 5 |
| 39 |
|
| 40 |
- name: "Upload to code-scanning" |
| 41 |
uses: github/codeql-action/upload-sarif@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1 |
| 42 |
with: |
| 43 |
sarif_file: results.sarif |