Skip to content

ci(scorecard): add OpenSSF Scorecard workflow + README badges#16

Merged
aksOps merged 2 commits into
mainfrom
chore/openssf-scorecard
May 1, 2026
Merged

ci(scorecard): add OpenSSF Scorecard workflow + README badges#16
aksOps merged 2 commits into
mainfrom
chore/openssf-scorecard

Conversation

@aksOps

@aksOps aksOps commented May 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • `.github/workflows/scorecard.yml` — runs OpenSSF Scorecard supply-chain analysis on push to main, weekly cron (Tue 03:00 UTC), branch_protection_rule events, and workflow_dispatch. SARIF uploaded to `/security/code-scanning`; results published to `api.scorecard.dev` so the live badge resolves. All third-party actions pinned by SHA (scorecard-action@v2.4.3, checkout@v4, upload-artifact@v7.0.1, codeql-action/upload-sarif@v4.35.2).
  • README.md — Scorecard badge added to the badge row.
  • Best Practices badge — requires a one-time human signup at bestpractices.dev (sign in with GitHub → fill the criteria checklist → get a numeric PROJECT_ID). The README contains an HTML comment with the exact markup to paste once the ID is assigned. Not shipped broken — the badge URL is only valid after registration.

Test plan

  • CI green
  • After merge, the `OpenSSF Scorecard` workflow runs against main; check the run logs for any soft warnings
  • Visit https://scorecard.dev/viewer/?uri=github.com/RandomCodeSpace/ctm — the badge in README should resolve once the first run lands
  • One-time follow-up: register at bestpractices.dev and substitute PROJECT_ID per the README comment

🤖 Generated with Claude Code

Adds .github/workflows/scorecard.yml — runs the OpenSSF Scorecard
supply-chain check on push to main, weekly cron, and on
branch_protection_rule changes. Results land in two places:

  - GitHub code-scanning (/security/code-scanning) via SARIF upload
  - Public Scorecard registry (api.scorecard.dev) via OIDC publish so
    the README badge resolves to a live score

All third-party actions are pinned to commit SHAs:
  - actions/checkout@v4
  - ossf/scorecard-action@v2.4.3
  - actions/upload-artifact@v7.0.1
  - github/codeql-action/upload-sarif@v4.35.2

README: add the Scorecard badge to the badge row, plus an HTML
comment with the one-time steps to register the project at
bestpractices.dev and append the Best Practices badge once a
PROJECT_ID has been issued (the badge URL is invalid until the
project is registered, so it's documented inline rather than
shipped broken).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment thread .github/workflows/scorecard.yml Fixed
Sonar githubactions:S8234 flagged 'permissions: read-all' as a
vulnerability. Job-level permissions already grant exactly what the
scorecard analyzer needs (security-events: write for SARIF upload,
id-token: write for OIDC publish, contents: read, actions: read);
the top-level grant is only a fallback for any future steps without
their own block, so contents:read is the right minimum.
@sonarqubecloud

sonarqubecloud Bot commented May 1, 2026

Copy link
Copy Markdown

@aksOps aksOps merged commit d467db5 into main May 1, 2026
11 checks passed
@aksOps aksOps deleted the chore/openssf-scorecard branch May 1, 2026 10:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants