-
Notifications
You must be signed in to change notification settings - Fork 0
chore(security): unify OSV Action v2.5.1 #1276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seonghobae
wants to merge
9
commits into
main
Choose a base branch
from
codex/osv-scanner-action-v2.5.1-unified-20260824
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c845be1
chore(security): unify OSV Action v2.5.1
seonghobae d935674
fix: align OSV reporter with scanner release
seonghobae 7e086ff
Merge remote-tracking branch 'origin/main' into HEAD
seonghobae 808b05e
docs(osv): align reusable workflow pin rationale
seonghobae dc0173b
Merge remote-tracking branch 'refs/remotes/origin/main' into HEAD
seonghobae 0a3ac2c
test(osv): cover yaml workflow pins
seonghobae 5b14089
test(osv): match action uses only
seonghobae 2bac668
Merge branch 'main' into codex/osv-scanner-action-v2.5.1-unified-2026…
opencode-agent[bot] 26187df
Merge branch 'main' into codex/osv-scanner-action-v2.5.1-unified-2026…
opencode-agent[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| # OSV-Scanner Action single-version boundary | ||
|
|
||
| ## Incident boundary | ||
|
|
||
| The central dependency scans invoke `google/osv-scanner-action` six times: | ||
| four scanner steps, their reporter gate, and the reusable pull-request scan. | ||
| All six remained on Action v2.3.8, while the stale dependency pull request | ||
| targeted v2.5.0 after v2.5.1 had become the current official release. | ||
|
|
||
| ## Decision | ||
|
|
||
| Pin every central scanner, reporter, and reusable workflow use to | ||
| `6e4298ebc4db23e847df9b2e2de2939d6f066c67`, the commit referenced by the | ||
| official v2.5.1 tag. That release preserves package namespaces, restores the | ||
| local database cache environment variable, and fixes offline vulnerability | ||
| matching (Google, 2026). | ||
|
|
||
| GitHub documents that a full commit SHA is unique and immutable and should be | ||
| verified against the action repository (GitHub, n.d.). A repository-wide | ||
| contract therefore parses every central workflow occurrence, checks the exact | ||
| component inventory, rejects malformed pins or mismatched comments, and admits | ||
| only the reviewed v2.5.1 SHA and tag. Scan arguments, timeouts, permissions, | ||
| exact-base/head comparison, reporter gates, and fail-closed dependency policy | ||
| are unchanged. | ||
|
|
||
| ## References | ||
|
|
||
| GitHub. (n.d.). *Using pre-written building blocks in your workflow*. | ||
| Retrieved August 24, 2026, from | ||
| https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/find-and-customize-actions | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| Google. (2026, August 17). *OSV-Scanner Action v2.5.1* [Software release]. | ||
| https://github.com/google/osv-scanner-action/releases/tag/v2.5.1 | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| """Keep every central OSV-Scanner Action use on one reviewed release.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import re | ||
| from collections import Counter | ||
| from pathlib import Path | ||
|
|
||
|
|
||
| REPO_ROOT = Path(__file__).resolve().parents[1] | ||
| OSV_ACTION_SHA = "6e4298ebc4db23e847df9b2e2de2939d6f066c67" | ||
| OSV_ACTION_TAG = "v2.5.1" | ||
| _PIN = re.compile( | ||
| r"google/osv-scanner-action/(?P<component>" | ||
| r"osv-scanner-action|osv-reporter-action|" | ||
| r"\.github/workflows/osv-scanner-reusable-pr\.yml)@" | ||
| r"(?P<sha>[^\s]+)\s+#\s+(?P<tag>v[^\s]+)" | ||
| ) | ||
| _EXPECTED_COMPONENTS = Counter( | ||
| { | ||
| "osv-scanner-action": 4, | ||
| "osv-reporter-action": 1, | ||
| ".github/workflows/osv-scanner-reusable-pr.yml": 1, | ||
| } | ||
| ) | ||
|
|
||
|
|
||
| def test_all_osv_scanner_actions_share_the_reviewed_current_release() -> None: | ||
| """Reject partial bumps, malformed refs, and stale OSV Action comments.""" | ||
| observed: set[tuple[str, str]] = set() | ||
| components: Counter[str] = Counter() | ||
|
|
||
| for path in sorted((REPO_ROOT / ".github/workflows").glob("*.y*ml")): | ||
| for line_number, line in enumerate( | ||
| path.read_text(encoding="utf-8").splitlines(), start=1 | ||
| ): | ||
| if "uses:" not in line or "google/osv-scanner-action/" not in line: | ||
| continue | ||
| match = _PIN.search(line) | ||
| assert match is not None, f"malformed OSV Action pin: {path}:{line_number}" | ||
| observed.add((match.group("sha"), match.group("tag"))) | ||
| components[match.group("component")] += 1 | ||
|
|
||
| assert observed == {(OSV_ACTION_SHA, OSV_ACTION_TAG)} | ||
| assert components == _EXPECTED_COMPONENTS |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.