name: OpenSSF Scorecard # Supply-chain / security-posture analysis (findings P13.1). Runs on a weekly # schedule, on branch-protection changes, and on push to main. `publish_results` # uploads the score to the public OpenSSF API so the README badge resolves, and # the SARIF is surfaced under the repo's Security → Code scanning tab. on: branch_protection_rule: schedule: - cron: '27 7 * * 2' # Tuesdays 07:27 UTC push: branches: [main] workflow_dispatch: # Read-only by default; the analysis job widens to exactly what it needs. permissions: read-all jobs: analysis: name: Scorecard analysis runs-on: ubuntu-latest permissions: security-events: write # upload the SARIF result to code-scanning id-token: write # OIDC token to publish results to the OpenSSF API steps: - name: Checkout code uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - name: Run Scorecard analysis uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3 with: results_file: results.sarif results_format: sarif # The default GITHUB_TOKEN cannot read classic branch-protection # rules, so the Branch-Protection check fails with an internal error # and scores -1. A read-only fine-grained PAT (Administration: read, # Contents: read, Metadata: read) supplied as SCORECARD_TOKEN lets the # check read the protection settings. See # https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md repo_token: ${{ secrets.SCORECARD_TOKEN }} # Publish to the public OpenSSF endpoint that backs the README badge. publish_results: true - name: Upload SARIF artifact uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: SARIF file path: results.sarif retention-days: 5 - name: Upload SARIF to code-scanning uses: github/codeql-action/upload-sarif@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2 with: sarif_file: results.sarif