Draft
fix(should-run): fix checkout-repo boolean gate; flip default to false#4714
Conversation
✅ Deploy Preview for nifty-bassi-e26446 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…alse
- Fix the composite-action string-boolean gotcha: `if: inputs.checkout-repo`
always evaluated true because composite inputs are strings. Change to
`if: inputs.checkout-repo == 'true'` so the literal string "false" is
correctly treated as falsy.
- Flip the default from `true` to `"false"` so the safe behaviour (no
working-tree mutation) is the default. Callers that relied on the
implicit checkout must now pass `checkout-repo: true` explicitly.
- Remove `type: boolean` from the input definition (not honoured in
composite actions, and was part of the confusion).
- Add three tests under actions/github/should-run/tests/:
• checkout-repo-false-preserves-tree.test.yml — regression: untracked
file survives when checkout-repo: false
• default-does-not-checkout.test.yml — default (omitted) also preserves
the working tree
• paths-match.test.yml — action produces run=true for a matching path
BREAKING CHANGE: the default for checkout-repo changes from true to false.
Callers that relied on should-run performing the initial checkout must add
`checkout-repo: true` to their invocation, or ensure their job already
checks out the repo with fetch-depth: 0 before calling this action.
Signed-off-by: phlax <ryan@cachopo.org>
Co-authored-by: phlax <454682+phlax@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix bug with checkout-repo flag in should-run action
fix(should-run): fix checkout-repo boolean gate; flip default to false
Jul 13, 2026
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.
In composite actions, all inputs are strings —
type: booleanis ignored andinputs.checkout-repois the literal string"false"when the caller passesfalse. GitHub Actions treats any non-empty string as truthy, soif: inputs.checkout-repowas always true, meaning the internalactions/checkoutran unconditionally, wiping untracked files (e.g. build artifacts) from the working tree mid-job.Changes
actions/github/should-run/action.ymlif: inputs.checkout-repo→if: inputs.checkout-repo == 'true'true→"false"— action no longer mutates the caller's working tree by defaulttype: boolean: not honoured in composite actions; was the source of confusionTests (
actions/github/should-run/tests/)New — this action previously had no tests:
checkout-repo-false-preserves-tree.test.ymlcheckout-repo: "false"default-does-not-checkout.test.ymlpaths-match.test.ymlrun: truewhen a committed file matches configuredpaths:The default for
checkout-repoflips fromtruetofalse. Callers that relied on the implicit checkout must now either:checkout-repo: trueexplicitly, oractions/checkoutwithfetch-depth: 0before calling this action