Skip to content

fix(ci): label-sync ignored apply=true and dry-ran every time - #19

Merged
alvaro-freire merged 1 commit into
mainfrom
fix/label-sync-apply
Sep 4, 2026
Merged

alvaro-freire merged 1 commit into
mainfrom
fix/label-sync-apply

Conversation

@alvaro-freire

@alvaro-freire alvaro-freire commented Sep 3, 2026 •

Copy link
Copy Markdown
Member

Closes #18.

label-sync.yml accepted apply=true and dry-ran anyway. Run 33779012797 logged 179 would create lines, created nothing, and reported success.

DRY: ${{ inputs.apply == true && '' || '--dry-run' }}

GitHub's &&/|| select a value rather than compute a boolean: A && B || C yields B only when B is itself truthy. The intended true branch here is the empty string, which is falsy, so every run fell through to --dry-run. The apply path was unreachable — and silently, because a dry run is a legitimate success, so nothing could fail.

Fix

Branch in the shell, where an empty string is not overloaded, and print the chosen mode to the log and the step summary so a repeat is visible rather than inferred from a missing side effect.

Verified

Dispatched from this branch with apply=true — run 33779196354:

mode: apply
44 repos | created 178 | recoloured 0 | failed 1

The one failure was rumi-app/rumi: HTTP 500, a transient API error rather than a logic fault; that label was created afterwards and a fresh --dry-run now reports created 0 | recoloured 0 | failed 0, i.e. nothing left to do.

The labels are live: software repos carry cowtrol, cross / platform, data, infra, rumi; hardware repos carry rumi and rumi pro. The label override documented in PROJECT_SYNC.md works everywhere for the first time — before this it existed only in management.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WjzymfEFess2pegpLiVjxp

Run 33779012797 was dispatched with apply=true, logged 179 "would create" lines,
created nothing, and reported success.

    DRY: ${{ inputs.apply == true && '' || '--dry-run' }}

GitHub's &&/|| select a value rather than compute a boolean: `A && B || C` yields
B only when B is itself truthy. The intended true branch here is the empty
string, which is falsy, so every run fell through to --dry-run. The apply path
was unreachable, and silently so -- a dry run is a legitimate success, so nothing
could fail.

Branch in the shell instead, where an empty string is not overloaded, and print
the chosen mode so a repeat is visible in the log and the step summary.
@alvaro-freire alvaro-freire self-assigned this Sep 4, 2026
@alvaro-freire
alvaro-freire merged commit 16e1248 into main Sep 4, 2026
3 of 4 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.

label-sync accepts apply=true and dry-runs anyway: the expression ternary cannot yield an empty string

2 participants