Skip to content

🐛 Recognize GitHub self-repository action references - #5191

Merged
justaugustus merged 3 commits into
ossf:mainfrom
trask:trask-fix-self-action-pinning
Sep 28, 2026
Merged

justaugustus merged 3 commits into
ossf:mainfrom
trask:trask-fix-self-action-pinning

Conversation

@trask

@trask trask commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

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-actions

What is the new behavior (if this is a feature change)?

  • Tests for the changes have been added (for bug fixes/features)

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.

uses: $/.github/actions/example

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?

Pinned-Dependencies supports GitHub self-repository action syntax

@trask
trask temporarily deployed to integration-test August 21, 2026 15:07 — with GitHub Actions Inactive
@trask trask changed the title Recognize GitHub self-repository action references 🐛 Recognize GitHub self-repository action references Aug 21, 2026
@codecov

codecov Bot commented Aug 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.52%. Comparing base (353ed60) to head (61bbfeb).
⚠️ Report is 376 commits behind head on main.

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Trask Stalnaker <trask.stalnaker@gmail.com>
@trask
trask force-pushed the trask-fix-self-action-pinning branch from 37425d5 to 8cdf03c Compare August 21, 2026 15:23
@trask
trask temporarily deployed to integration-test August 21, 2026 15:23 — with GitHub Actions Inactive
@trask
trask marked this pull request as ready for review August 21, 2026 15:39
@trask
trask requested a review from a team as a code owner August 21, 2026 15:39
@trask
trask requested review from jeffmendoza and spencerschrock and removed request for a team August 21, 2026 15:39
@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Aug 21, 2026
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

This pull request has been marked stale because it has been open for 10 days with no activity

@github-actions github-actions Bot added the Stale label Sep 1, 2026
@trask

trask commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

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 🙏

@jkreileder

Copy link
Copy Markdown
Contributor

@spencerschrock friendly ping - this is about to affect a lot of repos.

zizmor 1.30.0 (2026-08-30) added a self-repository audit that flags every uses: ./... in the default persona, recommends $/ instead, and ships an auto-fix. Repos running zizmor in pre-commit/CI will switch to $/ to clear it - and each one then loses a point on Pinned-Dependencies, even though GitHub itself treats $/ as pinned under its "require actions pinned to a SHA" policy.

It already hit two of my repos after adopting the syntax (both 10/10 → 9/10, the $/ references being the only warnings). With this PR's diff applied locally, the new tests pass and both are back to 10/10 with no other change in the results.

The check-linter failure is unrelated: panic: file requires newer Go version go1.27 (application built with go1.26).

@github-actions github-actions Bot removed the Stale label Sep 2, 2026

@bilaldeveloper4312 bilaldeveloper4312 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 $/.github/actions/... and $/.github/workflows/....\n- The PR's upstream unit, integration, CodeQL, dependency, generation, validation, DCO, Kusari, and patch-coverage checks passed.\n\nThe remaining check-linter failure reports a Go toolchain-version mismatch and is not caused by these two changed files. Since this branch is based on an older main commit, it should still be rebased or have CI rerun by the author/maintainer before merge. I was unable to capture a reliable independent local test result, so I am not claiming one here.\n\nApproved on the implementation and coverage; this is an independent review, not maintainer acceptance authority.

sergienko4 pushed a commit to sergienko4/israeli-bank-scrapers that referenced this pull request Sep 9, 2026
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>
sergienko4 added a commit to sergienko4/israeli-bank-scrapers that referenced this pull request Sep 9, 2026
)

* 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
distronode-com added a commit to distronode-corporation/district-core-rust that referenced this pull request Oct 21, 2026
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>
distronode-com added a commit to distronode-corporation/district-android that referenced this pull request Oct 21, 2026
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>
distronode-com added a commit to distronode-corporation/district-windows that referenced this pull request Oct 21, 2026
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>
zsltg added a commit to zsltg/iq that referenced this pull request Oct 23, 2026
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>
pcbeingused333 pushed a commit to pcbeingused333/atmos that referenced this pull request Oct 24, 2026
…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>
santosr2 added a commit to santosr2/TerraTidy that referenced this pull request Nov 3, 2026
* 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>
edithatogo added a commit to edithatogo/voiage that referenced this pull request Nov 16, 2026
## 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.

This branch was previously deployed

2 inactive deployments
integration-test — 61bbfeb6 Deployed Sep 28, 2026 by justaugustus via integration-trusted #12624
gitlab — 61bbfeb6 Deployed Sep 28, 2026 by justaugustus via gitlab-integration-trusted #5256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Feature - Pinned-Dependencies support self-repository GitHub actions syntax BUG: GitHub's self-repository syntax reported as unpinned dependencies

5 participants