Repository navigation
ci(vendor-boundary): don't silently pass on grep exit 2 - #3
Conversation
`if grep …; then exit 1; fi` only catches exit 0. grep exits 2 on missing dir / unreadable file / zsh word-splitting on some runners. Silent success on a grep error means the vendor-boundary enforcement decays to honor-system with no CI signal. Capture grep's exit code explicitly and treat 0=violation (exit 1), 1=no match (pass), anything else=check failure (exit 1 with a descriptive message). Pin the step's shell to bash so a runner switched to dash can't silently change semantics. Fixes the same shape in both call sites added by #1 (in-ci.yml job) and #2 (standalone workflow). Pattern from motofreedom PR morluto#265. Co-Authored-By: Claude Opus 4.7 <[email protected]>
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Both vendor-boundary call sites (the in-ci.yml job from #1, and the standalone workflow from #2) use
That only trips on grep exit 0. grep exits 2 on a missing directory, an unreadable file, or zsh word-splitting on some runners. Silent success on an exit-2 means the vendor-boundary enforcement decays to honor-system with no CI signal — the GPL carve-out and the process-boundary contract both lose their gate.
Fix: capture grep's exit code explicitly and switch on it.
0→ violation; print matches, emit::error::,exit 11→ no match; pass::error::grep failed with exit $rc. The vendor-boundary check did NOT actually run.,exit 1Also pin
shell: bashon both steps so a runner switched to dash/sh can't silently change semantics.Grep regexes are unchanged in both files — only the exit-code handling moves.
Files touched
.github/workflows/ci.yml— in-linevendor-boundaryjob (from docs(vendor): adopt the vendor-policy kit from motofreedom #1).github/workflows/vendor-boundary.yml— standalone workflow (from ci: standalone vendor-boundary workflow (no concurrency group) #2)Pattern ported from motofreedom PR morluto#265, where the same shape was fixed upstream of the vendor-policy kit this repo adopted.
🤖 Generated with Claude Code