| 1 |
name: Scorecard supply-chain security |
| 2 |
on: |
| 3 |
# For Branch-Protection check. Only the default branch is supported. See |
| 4 |
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection |
| 5 |
branch_protection_rule: |
| 6 |
# To guarantee Maintained check is occasionally updated. See |
| 7 |
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained |
| 8 |
schedule: |
| 9 |
- cron: '28 7 * * 2' |
| 10 |
push: |
| 11 |
branches: [ "main" ] |
| 12 |
|
| 13 |
# Declare default permissions as read only. |
| 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 |
|
| 26 |
|
| 27 |
steps: |
| 28 |
- name: "Checkout code" |
| 29 |
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 30 |
with: |
| 31 |
persist-credentials: false |
| 32 |
|
| 33 |
- name: "Run analysis" |
| 34 |
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 |
| 35 |
with: |
| 36 |
results_file: results.sarif |
| 37 |
results_format: sarif |
| 38 |
# (Optional) "write" PAT token. Uncomment the `repo_token` line below to |
| 39 |
# enable the Branch-Protection check. |
| 40 |
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional. |
| 41 |
# repo_token: ${{ secrets.SCORECARD_TOKEN }} |
| 42 |
|
| 43 |
# Public repositories: |
| 44 |
# - Publish results to OpenSSF REST API for easy access by consumers |
| 45 |
# - Allows the repository to include the Scorecard badge. |
| 46 |
# - See https://github.com/ossf/scorecard-action#publishing-results. |
| 47 |
publish_results: true |
| 48 |
|
| 49 |
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF |
| 50 |
# format to the repository Actions tab. |
| 51 |
- name: "Upload artifact" |
| 52 |
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0.pre.node20 |
| 53 |
with: |
| 54 |
name: SARIF file |
| 55 |
path: results.sarif |
| 56 |
retention-days: 5 |
| 57 |
|
| 58 |
# Upload the results to GitHub's code scanning dashboard (optional). |
| 59 |
# Commenting out will disable upload of results to your repo's Code Scanning dashboard |
| 60 |
- name: "Upload to code-scanning" |
| 61 |
uses: github/codeql-action/upload-sarif@c10b8064de6f491fea524254123dbe5e09572f13 # v4.35.1 |
| 62 |
with: |
| 63 |
sarif_file: results.sarif |