Scorecard supply-chain security #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Scorecard supply-chain security | |
| # ⚠️ API INTEGRITY RULES (enforced when publish_results: true): | |
| # - NO top-level `env:` or `defaults:` blocks in this file | |
| # - NO workflow-level write permissions | |
| # - ONLY this job may use id-token: write | |
| # Violating any of these causes the publish step to be REJECTED by api.scorecard.dev | |
| on: | |
| branch_protection_rule: | |
| schedule: | |
| - cron: '23 8 * * 6' | |
| push: | |
| # Branch-Protection check ONLY works on the default branch (Must match your actual default branch). | |
| branches: ["main"] | |
| workflow_dispatch: | |
| permissions: read-all | |
| jobs: | |
| analysis: | |
| name: Scorecard analysis | |
| runs-on: ubuntu-latest | |
| if: | | |
| !github.event.repository.fork && | |
| (github.event.repository.default_branch == github.ref_name || | |
| github.event_name == 'workflow_dispatch' || | |
| github.event_name == 'pull_request') | |
| permissions: | |
| security-events: write | |
| id-token: write | |
| actions: read | |
| contents: read | |
| steps: | |
| - name: "Harden Runner" | |
| uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 | |
| with: | |
| disable-sudo-and-containers: false | |
| egress-policy: block | |
| allowed-endpoints: > | |
| github.com:443 | |
| api.github.com:443 | |
| codeload.github.com:443 | |
| *.actions.githubusercontent.com:443 | |
| *.blob.core.windows.net:443 | |
| api.osv.dev:443 | |
| api.scorecard.dev:443 | |
| fulcio.sigstore.dev:443 | |
| rekor.sigstore.dev:443 | |
| sigstore-tuf-root.storage.googleapis.com:443 | |
| oauth2.sigstore.dev:443 | |
| - name: "Checkout code" | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: "Run analysis" | |
| uses: ossf/scorecard-action@v2.4.0 | |
| 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 | |
| # Upload the results to GitHub's code scanning dashboard. | |
| - name: "Upload to code-scanning" | |
| uses: github/codeql-action/upload-sarif@v3 | |
| with: | |
| sarif_file: results.sarif |