Skip to content

feat(scorecard): drop the kit's own major-tag channel from Pinned-Dependencies before upload - #247

Merged
mjdevaccount merged 2 commits into
mainfrom
fix/scorecard-own-channel
Dec 4, 2026
Merged

mjdevaccount merged 2 commits into
mainfrom
fix/scorecard-own-channel

Conversation

@mjdevaccount

Copy link
Copy Markdown
Owner

Why

Scorecard's Pinned-Dependencies check treats every uses: owner/repo@tag as an unpinned third-party action. That includes mjdevaccount/ci-kit@v1, so each caller step that follows the kit's v1 channel opened a medium code-scanning alert, even though v1 moves by design (docs/versioning.md).

Dismissing those alerts by hand did not hold. When the score text changed, the alert re-opened as a new one. Examples:

Four such alerts are open right now: ci-kit #102/#103, groundwork #21 and work-timeline #17.

What

  • New step. The reusable scorecard.yml gains an own-channel step that runs before the upload. It is a jq filter that drops exactly the PinnedDependenciesID results whose flagged ref (region.snippet.text) is <own-channel>@v<N> or <own-channel>/<path>@v<N>. Once those results stop appearing in the upload, code scanning closes their alerts as fixed.
  • What stays. Everything else is kept:
    • third-party refs
    • own refs at @main or @vX.Y.Z
    • look-alike repos (ci-kit-evil, other/ci-kit)
    • other rules
    • results with no snippet
    • any result that has a foreign location
  • Telemetry:
    • The job summary lists every dropped ref.
    • The 5-day artifact keeps the unfiltered SARIF next to the uploaded one.
    • An unreadable SARIF, or a count mismatch, fails the step and nothing is uploaded. scorecard-self and caller runs going red are watched by the scheduled-workflow audit.
  • Opt-out. The new input own-channel defaults to mjdevaccount/ci-kit; set it to '' to keep every result.
  • Why jq and not a new ci_kit tool. The reusable and the action share the v1 tag, so a tool added in this release would be unknown to the action until v1 moves.
  • Version: 1.97.0.

Test plan

  • tests/test_scorecard_own_channel_must_fire.py runs the workflow's own run: script under bash against SARIF shaped like Scorecard's output. It covers what must be dropped, the look-alikes that must be kept, a disabled channel, a mixed-location result, and an unreadable SARIF (step fails and writes no output). It also checks the wiring: the step's env, the default channel, and that upload-sarif reads the step's output.
  • Mutations each fail the suite:
    • accept any v-tag
    • match on the bare prefix instead of <own-channel>/
    • upload the raw results file
  • Run on a real work-timeline Scorecard SARIF: 12 results, 6 own-channel refs dropped, 6 uploaded (open alert feat(env-reads): ci-env-reads -- a shrink-only ratchet on hand .env pipelines in shell (v1.8.0) #17 among the dropped).
  • Full suite: 3511 passed, 42 skipped. ruff clean, actionlint clean (docker, same as CI).
  • Fresh-context reviewer: its one blocker (actionlint SC2016) and its coverage gap (wiring) are fixed in the second commit.

🤖 Generated with Claude Code

zer0bscured and others added 2 commits December 4, 2026 11:41
…endencies before upload

Scorecard's Pinned-Dependencies check calls every `uses: owner/repo@tag`
third-party, so each `mjdevaccount/ci-kit@v1` step a caller adds opened a
medium code-scanning alert, though `v1` moves by design. Hand dismissals did
not hold: the alert re-opened as a new one whenever the score text changed
(one caller line was dismissed twice and opened a third time).

A jq step in the reusable now drops exactly the Pinned-Dependencies results
whose flagged ref (`region.snippet.text`) is `<own-channel>@v<N>` or
`<own-channel>/<path>@v<N>`; code scanning closes their alerts as fixed.
Third-party refs, own refs at `@main` / `@vX.Y.Z`, look-alike repos and
other rules all stay. The dropped refs go to the job summary, the artifact
keeps the unfiltered SARIF next to the uploaded one, and a count mismatch or
an unreadable SARIF fails the step (no upload). `own-channel: ''` disables.

The must-fire test runs the workflow's own run: script against SARIF in
Scorecard's shape; two mutations (any v-tag, bare prefix match) each fail it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e filter's wiring into the upload

actionlint (CI's step) flagged $own inside the single-quoted jq program; it is a
jq variable. The new test asserts the step's env, the default channel, and that
upload-sarif reads the step's output after it runs: reverting sarif_file to the
raw results file fails it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@mjdevaccount
mjdevaccount enabled auto-merge (squash) December 4, 2026 17:54
@mjdevaccount
mjdevaccount merged commit 42e56c0 into main Dec 4, 2026
10 checks passed
@mjdevaccount
mjdevaccount deleted the fix/scorecard-own-channel branch December 4, 2026 18:01
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