Skip to content

fix(should-run): fix checkout-repo boolean gate; flip default to false#4714

Draft
phlax with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-checkout-repo-flag
Draft

fix(should-run): fix checkout-repo boolean gate; flip default to false#4714
phlax with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-checkout-repo-flag

Conversation

Copilot AI commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

In composite actions, all inputs are strings — type: boolean is ignored and inputs.checkout-repo is the literal string "false" when the caller passes false. GitHub Actions treats any non-empty string as truthy, so if: inputs.checkout-repo was always true, meaning the internal actions/checkout ran unconditionally, wiping untracked files (e.g. build artifacts) from the working tree mid-job.

Changes

actions/github/should-run/action.yml

  • Fix gate: if: inputs.checkout-repoif: inputs.checkout-repo == 'true'
  • Flip default: true"false" — action no longer mutates the caller's working tree by default
  • Remove type: boolean: not honoured in composite actions; was the source of confusion
  • Updated input description to document caller expectations

Tests (actions/github/should-run/tests/)

New — this action previously had no tests:

Test Covers
checkout-repo-false-preserves-tree.test.yml Regression: untracked file survives with explicit checkout-repo: "false"
default-does-not-checkout.test.yml Default (omitted input) also preserves the working tree
paths-match.test.yml Action produces run: true when a committed file matches configured paths:

⚠️ Breaking change

The default for checkout-repo flips from true to false. Callers that relied on the implicit checkout must now either:

  • Pass checkout-repo: true explicitly, or
  • Ensure their job already performs actions/checkout with fetch-depth: 0 before calling this action

@netlify

netlify Bot commented Jul 13, 2026

Copy link
Copy Markdown

Deploy Preview for nifty-bassi-e26446 ready!

Name Link
🔨 Latest commit 42b2199
🔍 Latest deploy log https://app.netlify.com/projects/nifty-bassi-e26446/deploys/6a54c8af3de07900081a2d93
😎 Deploy Preview https://deploy-preview-4714--nifty-bassi-e26446.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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
Copilot finished work on behalf of phlax July 13, 2026 11:15
Copilot AI requested a review from phlax July 13, 2026 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants