🐛 Split ko matcher so either setup-ko spelling is detected - #5195
Open
rylena wants to merge 1 commit into
Open
Conversation
JobMatcher.matches() requires every listed step to match (AND semantics). The ko entry listed both imjasonh/setup-ko and ko-build/setup-ko as steps of one JobMatcher, but a workflow uses only one of them, so the matcher could never fire and ko publishing was never detected by the Packaging check. Split it into two single-step matchers (the shape every other ecosystem entry uses) and add test fixtures for both spellings. Fixes ossf#5133 Signed-off-by: Rylen Anil <rylen.anil@gmail.com>
rylena
requested review from
AdamKorcz and
justaugustus
and removed request for
a team
August 24, 2026 05:08
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.
Description
Fixes #5133.
The ko entry in
IsPackagingWorkflow(checks/fileparser/github_workflow.go) listedimjasonh/setup-koandko-build/setup-koas two steps of a singleJobMatcher.JobMatcher.matches()requires every listed step to match (AND semantics), but a real workflow uses only one of the two spellings — they are the pre-/post-rename names of the same action — so the ko matcher could never fire and ko container publishing was never detected by the Packaging check.This change splits the entry into two single-step matchers, which is the shape every other ecosystem entry uses, and adds test fixtures for both spellings.
Additive only: no existing workflow's detection result can change; ko workflows simply move from "packaging workflow not detected" to detected.
Verification
Reproduced failing-then-passing with the new fixtures:
go test ./checks/fileparser -run 'TestIsPackagingWorkflow/ko' -count=1→FAIL: TestIsPackagingWorkflow/ko_publish_(renamed_action)andFAIL: .../ko_publish_(legacy_action)(isPackagingWorkflow() = false, expected true)go test ./checks/fileparser -run 'TestIsPackagingWorkflow' -count=1→ all 20 subtests PASS (including the 2 new ones)go test ./checks/fileparser -count=1→ full package suite PASSgofmt -l checks/fileparser/→ cleango vet ./checks/fileparser→ cleangit diff --check→ cleanSigned-off per CONTRIBUTING.md (DCO).