Skip to content

Compare boolean inputs instead of executing them - #21

Merged
TobKed merged 3 commits into
masterfrom
fix/boolean-inputs
Aug 22, 2026
Merged

TobKed merged 3 commits into
masterfrom
fix/boolean-inputs

Conversation

@TobKed

@TobKed TobKed commented Aug 22, 2026

Copy link
Copy Markdown
Owner

1. force and tags were executed, not compared

if ${INPUT_FORCE}; then    # runs the input as a command
  • force: true — worked only because /usr/bin/true exits 0
  • force: yes — ran yes, hanging the job until the runner timed out
  • force: 1command not found, and set -e aborted the sync

Both are now compared against "true". Anything else is inert, as the README already documents. Workflows passing true/false are unaffected.

A pygrep pre-commit hook fails the build if the executing form comes back.

2. .gitignore

.DS_Store and .idea/ were untracked and one git add -A from being committed.

3. Read-only CI token

permissions: contents: read — neither job needs write.

🤖 Generated with Claude Code

https://claude.ai/code/session_01X1sz7entAqb4B2Hycm9YF4

TobKed and others added 3 commits August 22, 2026 19:34
`if ${INPUT_FORCE}; then` did not compare the input, it ran it as a
command. `force: true` worked only because /usr/bin/true exists, while
`force: yes` ran `yes` and hung the job until the runner timed out, and
any other string was executed verbatim.

Both flags are now compared against the string "true". Values that are
not "true" are inert, which matches how the README documents them.

test_start.sh covers this with a stub `git` on PATH, so it needs no
token and no network. It hangs on the old code and passes on the new.

Also adds a .gitignore for .DS_Store/.idea and a read-only default
token scope for the CI workflow.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X1sz7entAqb4B2Hycm9YF4
test_start.sh was 55 lines of stub-git plumbing guarding two lines of
string comparison. It paid for itself while proving the bug and the
fix, but as a permanent fixture the ratio does not hold up.

The regression worth guarding is a syntax pattern, so a pygrep hook
catches it directly: it fails on `if ${INPUT_...}` and reports the
offending line numbers. Verified against the pre-fix start.sh.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X1sz7entAqb4B2Hycm9YF4
The pattern missed `if "${INPUT_X}"`, which still executes the input,
and the while/until forms. Widening it costs ten characters and no
readability, and it does not fire on the `[ "$x" = "true" ]` or
`[ -z "$x" ]` forms the script actually uses.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X1sz7entAqb4B2Hycm9YF4
@TobKed
TobKed merged commit 52429f0 into master Aug 22, 2026
2 checks passed
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.

1 participant