Repository navigation
feat(scorecard): drop the kit's own major-tag channel from Pinned-Dependencies before upload - #247
Merged
Merged
Conversation
…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>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Scorecard's Pinned-Dependencies check treats every
uses: owner/repo@tagas an unpinned third-party action. That includesmjdevaccount/ci-kit@v1, so each caller step that follows the kit'sv1channel opened a medium code-scanning alert, even thoughv1moves 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:
ci.yml:48: dismissed as fix(pr-autoupdate): name gh's stderr when a gh call fails the run #11, then feat(dup-code): ci-dup-code -- the same code written twice fails the PR (jscpd behind a shrink-only baseline) (v1.10.0) #20, and opened again as fix(action): set -f before word-splitting args -- a glob reaches the tool as written (v1.10.1) #21.ci.yml:40: dismissed as feat(site_lint): check -- the pass/fail CLI for a gate with no baseline, v1.4.0 #7, then feat(major-tag): callable via workflow_call so other repos share the v1 mover #16, and opened again as feat(env-reads): ci-env-reads -- a shrink-only ratchet on hand .env pipelines in shell (v1.8.0) #17.Four such alerts are open right now: ci-kit #102/#103, groundwork #21 and work-timeline #17.
What
scorecard.ymlgains anown-channelstep that runs before the upload. It is a jq filter that drops exactly thePinnedDependenciesIDresults 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.@mainor@vX.Y.Zci-kit-evil,other/ci-kit)scorecard-selfand caller runs going red are watched by the scheduled-workflow audit.own-channeldefaults tomjdevaccount/ci-kit; set it to''to keep every result.v1tag, so a tool added in this release would be unknown to the action untilv1moves.Test plan
tests/test_scorecard_own_channel_must_fire.pyruns the workflow's ownrun: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.v-tag<own-channel>/🤖 Generated with Claude Code