From 165575dcc4dc2c2b73bec13869228bcf9b0b8709 Mon Sep 17 00:00:00 2001 From: Ryan Hill Date: Thu, 20 Aug 2026 16:45:19 -0500 Subject: [PATCH] Add OpenSSF Scorecard workflow to publish a public security score Mirrors qBraid/qBraid#1343 so the two repositories are graded the same way. Runs weekly and on pushes to main, checks supply-chain practices such as branch protection, token permissions, dependency pinning and signed releases, uploads SARIF to code scanning, and publishes the aggregate score. publish_results: true is what makes the score publicly visible; it reports check results, not source. Expect a middling first score. Several checks will fail on things already known here, and that is the point of establishing a baseline. --- .github/workflows/scorecard.yml | 46 +++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/scorecard.yml diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml new file mode 100644 index 0000000..40acfd3 --- /dev/null +++ b/.github/workflows/scorecard.yml @@ -0,0 +1,46 @@ +name: OpenSSF Scorecard + +on: + branch_protection_rule: + schedule: + - cron: '31 5 * * 1' + push: + branches: [ main ] + workflow_dispatch: + +permissions: read-all + +jobs: + analysis: + name: Scorecard analysis + runs-on: ubuntu-latest + permissions: + security-events: write # upload SARIF to code scanning + id-token: write # publish results to the public Scorecard API + contents: read + actions: read + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Run analysis + uses: ossf/scorecard-action@v2 + with: + results_file: results.sarif + results_format: sarif + publish_results: true + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: SARIF file + path: results.sarif + retention-days: 5 + + - name: Upload to code scanning + uses: github/codeql-action/upload-sarif@v3 + with: + sarif_file: results.sarif