Repository navigation
🐛 Recognize GitHub self-repository action references - #5191
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5191 +/- ##
==========================================
+ Coverage 66.80% 75.52% +8.72%
==========================================
Files 230 252 +22
Lines 16602 13970 -2632
==========================================
- Hits 11091 10551 -540
+ Misses 4808 3418 -1390
+ Partials 703 1 -702 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Signed-off-by: Trask Stalnaker <trask.stalnaker@gmail.com>
37425d5 to
8cdf03c
Compare
|
This pull request has been marked stale because it has been open for 10 days with no activity |
adding some activity to hopefully keep this alive 🙏 |
|
@spencerschrock friendly ping - this is about to affect a lot of repos. zizmor 1.30.0 (2026-08-30) added a It already hit two of my repos after adopting the syntax (both 10/10 → 9/10, the The |
bilaldeveloper4312
left a comment
There was a problem hiding this comment.
Independent code/documentation review:\n\n- GitHub's current Actions documentation explicitly defines $/path/to/dir as a same-repository reference resolved at the running commit and recommends it alongside the existing ./ form: https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/find-and-customize-actions#adding-an-action-from-the-same-repository\n- isSameRepositoryReference is applied to both step actions and job-level reusable workflow calls, and isActionDependencyPinned now uses the same rule.\n- The tests cover the helper, the pinning predicate, and parsing a workflow containing both
Scorecard v2.4.4 cannot parse GitHub's `$/` self-repository syntax and reports every `uses: $/…` reference as an unpinned third-party action — 28 false PinnedDependenciesID code-scanning alerts. Reverting the syntax is not an option: zizmor's self-repository audit requires `$/` and GitHub treats it as a form of pinning, so `./`/`owner/repo@sha` both regress security or fork-safety. Add scripts/filter-scorecard-sarif.mjs, run between ossf/scorecard-action and github/codeql-action/upload-sarif, dropping only the PinnedDependenciesID results whose flagged source line is a `$/` reference. A genuinely unpinned third-party action never matches `$/`, so it is still reported. zizmor stays green (`$/` untouched) and code scanning stays clean. The 28 alerts clear as fixed on the next Scorecard run on main. Upstream tracking: ossf/scorecard#5191 (open). Tests: - FSS-* (FilterScorecardSarif.test.ts): the security property — real unpinned third-party actions survive the filter; `$/` hits are dropped. - SCF-* (WorkflowSecurityGate.test.ts): the filter runs after Scorecard and before the SARIF upload. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
) * ci(scorecard): strip $/ self-repository false positives from SARIF Scorecard v2.4.4 cannot parse GitHub's `$/` self-repository syntax and reports every `uses: $/…` reference as an unpinned third-party action — 28 false PinnedDependenciesID code-scanning alerts. Reverting the syntax is not an option: zizmor's self-repository audit requires `$/` and GitHub treats it as a form of pinning, so `./`/`owner/repo@sha` both regress security or fork-safety. Add scripts/filter-scorecard-sarif.mjs, run between ossf/scorecard-action and github/codeql-action/upload-sarif, dropping only the PinnedDependenciesID results whose flagged source line is a `$/` reference. A genuinely unpinned third-party action never matches `$/`, so it is still reported. zizmor stays green (`$/` untouched) and code scanning stays clean. The 28 alerts clear as fixed on the next Scorecard run on main. Upstream tracking: ossf/scorecard#5191 (open). Tests: - FSS-* (FilterScorecardSarif.test.ts): the security property — real unpinned third-party actions survive the filter; `$/` hits are dropped. - SCF-* (WorkflowSecurityGate.test.ts): the filter runs after Scorecard and before the SARIF upload. * ci(scorecard): make the SARIF filter guard and its tests fail loudly The entry guard compared `argv[1]` to a path derived from `import.meta.url`. Node resolves the module specifier through symlinks while leaving `argv[1]` as written, so the comparison returned false whenever the script was reached by a symlink: `main()` never ran, the SARIF uploaded unfiltered, and the step still exited 0. A security control silently did nothing. Both sides are now canonicalised through `realpathSync`, which also covers `--preserve-symlinks-main` (where Node preserves the symlink instead), and canonicalisation is allowed to throw rather than be caught into `false` so an unresolvable entry fails loudly. The accompanying cases shared one bug class: an assertion that can silently stop asserting. - SCF-2 compared step ordering against `findIndex`'s -1 sentinel, so deleting the Scorecard producer step left `filterAt > -1` trivially true. Verified: with the producer removed the old case passed 39/39. - SCF-3 relied on the comparison direction for the same protection. - FSS-6 said "and counts them" but asserted no count. - The filter reduces over every SARIF run, yet every fixture had one run, so narrowing it to `runs[0]` kept the suite green (FSS-8). - The fixture resolver returned '' for an unmapped key, which is not a `$/` reference, so the "keeps a third-party action" cases would pass while exercising the unresolved-line path. It now throws. - Nothing pinned the security property as a negative: loosening the rule to a bare `$/` substring dropped genuine unpinned third-party findings with the suite still green (FSS-9, FSS-10). Each assertion was mutation-verified to fail on the regression it names. * ci(scorecard): confine SARIF uris to the workspace and cover rule.id `diskResolver` passed the SARIF uri straight to `join(root, uri)`. SARIF is machine-generated input, and a `..` segment escaped the checkout: `join('/tmp/tv/repo', '../outside.yml')` reads `/tmp/tv/outside.yml`. That is not only an information concern — if the file read happens to contain a line resembling `uses: $/…`, the filter suppresses a genuine unpinned-dependency alert. Uris now resolve against the root and must stay inside it, which also rejects an absolute uri that `resolve` would otherwise let discard the root entirely. Both escapes were verified to be refused, leaving the findings in place. `primaryLocation` used a JSDoc `any` cast at the point where untrusted SARIF is parsed, disabling checking exactly where it is most wanted. It now uses named typedefs; the runtime `typeof` validation is unchanged. The test's `ISarifResult` required `ruleId`, but the filter also accepts the id via `rule.id`. Nothing covered that fallback, so removing it left every `$/` false positive unfiltered with the suite still green — the same class as the earlier findings. `ruleId` is now optional, `rule.id` is modelled, and FSS-11 pins the fallback; it fails when the fallback is removed. * ci(scorecard): parameterise the repeated single-result filter cases SonarCloud S5976 flagged three structurally identical cases as new debt on the PR, blocking the count gate. They differ only in the fixture line and the rule id, which is what the repo's "config arrays over duplication" rule already asks to be a table. FSS-1/2 become a `DROPPED_CASES` table and FSS-3/4/9/10 a `KEPT_CASES` table, with the security rationale attached to the table rather than repeated per case. FSS-5 stays standalone because its input differs in kind: it carries no physical location at all. Every test id is preserved, so the docs and CI logs still resolve. The loosened-rule mutation (matching a bare `$/` substring) still fails FSS-9 and FSS-10, confirming the tables did not weaken the negative cases that protect genuine third-party findings. Co-authored-by: sergienko4
v2.4.4 runs Scorecard v5.5.0, which reads GitHub's self-repository `uses: $/.github/...` references as third-party actions that are not pinned by hash: every Pinned-Dependencies warning this repository gets. v5.6.0 treats `$/` like `./` (ossf/scorecard#5191), and v2.4.4 pulls its image from gcr.io, which Scorecard has retired. v2.5.0 was published 2026-10-12, outside the 7-day hold; fa7117db is the commit its annotated tag points at. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
v2.4.4 runs Scorecard v5.5.0, which reads GitHub's self-repository `uses: $/.github/...` references as third-party actions that are not pinned by hash: every Pinned-Dependencies warning this repository gets. v5.6.0 treats `$/` like `./` (ossf/scorecard#5191), and v2.4.4 pulls its image from gcr.io, which Scorecard has retired. v2.5.0 was published 2026-10-12, outside the 7-day hold; fa7117db is the commit its annotated tag points at. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
v2.4.4 runs Scorecard v5.5.0, which reads GitHub's self-repository `uses: $/.github/...` references as third-party actions that are not pinned by hash: every Pinned-Dependencies warning this repository gets. v5.6.0 treats `$/` like `./` (ossf/scorecard#5191), and v2.4.4 pulls its image from gcr.io, which Scorecard has retired. v2.5.0 was published 2026-10-12, outside the 7-day hold; fa7117db is the commit its annotated tag points at. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Scorecard v5.6.0 accepts the self-repository form $/.github/... (ossf/scorecard#5191). scorecard-action v2.5.0 runs it, and main pins that version. Go back to $/ for the setup-go action and the install-smoke workflow. Delete .github/zizmor.yml, which turned off the zizmor self-repository audit. Restore .github/actionlint.yaml, because actionlint does not know the form yet (rhysd/actionlint#732). The rename of .agents/security-index.md stays, because ossf/scorecard#5198 is still open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Zsolt Gaspar <17578237+zsltg@users.noreply.github.com>
…posse#3503) Scorecard v5.6.0 (bundled in scorecard-action v2.5.0) recognizes GitHub's self-repository `$/` action syntax, so Pinned-Dependencies no longer reports our same-repository harden-runner references as unpinned (ossf/scorecard#5232, fixed by ossf/scorecard#5191). Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* ci(scorecard): bump scorecard-action to v2.5.0 v2.4.4 bundles a Scorecard that doesn't know GitHub's `uses: $/` self-repository syntax, so it reported all 29 `$/` references in action-test.yml as unpinned third-party actions. v2.5.0 ships Scorecard v5.6.0, which treats them like `./` local actions (ossf/scorecard#5191). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(deps): bump filelock and certifi past open advisories filelock 3.29.5 -> 4.2.7 in the pre-commit requirements (fixed in 4.2.1; virtualenv accepts filelock<5) and certifi 2026.6.17 -> 2026.10.23 in the docs requirements (fixed in 2026.10.18). Regenerated with the uv pip compile command in each file's header, upgrading only those packages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
## Summary Update OpenSSF Scorecard Action to the signed v2.5.0 release, which includes Scorecard v5.6.0. Its [same-repository parser fix](ossf/scorecard#5191) recognizes the existing `$/` reusable-workflow reference, addressing alert #1331 while retaining GitHub's recommended syntax. Add contract coverage for the selected action, output settings, and reusable-workflow inputs. ## Verification - The final candidate passed the complete guarded `tox run-parallel -p 2`: 15 environments, 5,987 tests passed, 40 skipped, and 94.90% coverage on Python 3.15.2. Current-head hosted checks passed: 50 passed and three skipped. - The strict dependency-frontier audit passed. Its unrelated lock upgrades were preserved as a preview and are not included in this PR. - A provenance-verified Scorecard v5.6.0 CLI scanned exact copies of the three relevant workflows without publishing: Pinned-Dependencies scored 10/10, while a deliberately unpinned control was detected. This does not establish a full-repository or hosted Action result. - The Scorecard workflow runs on main pushes, so hosted Action execution and alert readback remain post-merge checks. The outer action is pinned to the v2.5.0 commit; its action metadata references a version-tagged GHCR container image rather than an image digest, as did the previous action release.
What kind of change does this PR introduce?
(Is it a bug fix, feature, docs update, something else?)
What is the current behavior?
Lack of support for new GitHub action syntaxt
$/your-local-file-with-actionsWhat is the new behavior (if this is a feature change)?
Which issue(s) this PR fixes
Fixes #5232
Fixes #5216
Special notes for your reviewer
Treat GitHub's
$/syntax as a same-repository reference in the Pinned-Dependencies check, matching the existing handling for./references.See the shared-workflows usage that exposed this false positive.
GitHub documents that this syntax resolves from the workflow repository at the running commit, so Scorecard no longer reports these actions or reusable workflows as unpinned third-party dependencies.
Note: the CI failure appears to be unrelated to this PR: golangci-lint / check-linter (pull_request)
Does this PR introduce a user-facing change?