fix(lint): use string comparison to dodge GHA == coercion#15
Merged
Conversation
GHA's `==` operator does loose-numeric coercion, so `false == null` evaluates to TRUE (both coerce to 0). That defeated the previous `inputs.X == null || inputs.X` skip-condition: when a caller passed `run_prettier: false`, the `null` clause matched and the job ran anyway. Verified on whois-api-llc/wxa-jake-ai#181 + wxa_vpn#180 — both still ran prettier despite explicit run_prettier: false. Switch to `format('{0}', inputs.X) != 'false'`: - self-test (inputs.X is null): format() → '' → '' != 'false' = true → run - workflow_call X=true: 'true' != 'false' = true → run - workflow_call X=false: 'false' != 'false' = false → skip Same fix applied to: - actionlint job-level if (run_actionlint) - prettier job-level if (run_prettier) - install-deps step-level if (install_node_deps) - run_shellcheck check inside actionlint step (also was using the coercion-broken `== true && '...' || '...'` pattern) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
No issues found. The |
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.
Summary
Critical fix for the reusable lint workflow's input-driven skip logic. Discovered while watching the install-fanout PRs (wxa-jake-ai#181 + wxa_vpn#180): both set `run_prettier: false` in the caller, but the prettier job ran anyway.
Root cause
GHA's `==` operator does loose-numeric coercion. `null` and `false` both coerce to `0`, so `false == null` evaluates to true. The previous condition
```yaml
if: ${{ inputs.run_prettier == null || inputs.run_prettier }}
```
was supposed to mean "run on self-test (input null) OR when explicitly true." But when the caller passed `run_prettier: false`, the `== null` clause matched (false coerces to null!) and the job always ran.
Fix
`format('{0}', inputs.X)` returns:
So:
```yaml
if: ${{ format('{0}', inputs.run_prettier) != 'false' }}
```
Applied to:
After this lands
wxa-jake-ai#181 and wxa_vpn#180 will correctly skip the prettier job on next CI re-run.
🤖 Generated with Claude Code