fix(ci): indented heredoc terminator broke the bump workflow's post-CI job - #2555
Merged
Merged
Conversation
…I job Fourth and last layer. With #2542, #2552 and #2553 in, the workflow finally did its job — create-pr SUCCEEDED and opened #2554, "bump upstream to v2.9", the first bump PR this workflow has ever produced. post-ci then failed: /home/runner/work/_temp/....sh: line 31: syntax error: unexpected end of file The "Handle CI result" step wrote its comment with cat > /tmp/failure_comment.md << 'COMMENT' ... COMMENT <- indented `<<` requires the delimiter at column 0. `<<-` strips leading TABS only, not the spaces this file is indented with. So bash never found the terminator, swallowed the remainder of the script, and died at EOF. The step could never have run. Reproduced and verified both directions rather than asserted: old step, bash -n: warning: here-document at line 13 delimited by end-of-file (wanted `COMMENT') line 31: syntax error: unexpected end of file exit 2 new step, bash -n: clean That old error is character-for-character what the CI run printed. Replaced the heredoc with a brace group redirected to the file. That also removes a second latent bug in the same step: the placeholder+sed dance it needed used sed -i "s|PLACEHOLDER|${FAILED_JOBS:-"- CI did not..."}|" ... which nests double quotes inside a double-quoted sed expression. The brace group needs no placeholder and no sed, so both problems go away rather than being patched. Running total on this one workflow, each defect reachable only after the one in front of it was fixed: 1 missing GH_TOKEN, on a step gated to run only when a bump is due #2542 2 gh pr create --jq #2552 3 stranded branch blocked the push #2553 4 indented heredoc terminator this Every one of them sat behind a gate that only opens when its predecessor is repaired. That is why months of green meant nothing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Fourth and final layer — and the workflow now works
With #2542, #2552 and #2553 in, this workflow finally did its job:
create-prsucceeded and opened #2554 —chore(agent-zero): bump upstream to v2.9, the first bump PR it has ever produced.post-cithen failed:Cause
The "Handle CI result" step wrote its comment with:
<<requires the delimiter at column 0.<<-strips leading tabs only, not the spaces this file is indented with. Bash never found the terminator, swallowed the rest of the script, and died at EOF.This step could never have run.
Verified both directions, not asserted
bash -nwarning: here-document at line 13 delimited by end-of-file (wanted 'COMMENT')→line 31: syntax error: unexpected end of file, exit 2That old error is character-for-character what the CI run printed.
Fix
Replaced the heredoc with a brace group redirected to the file. That also removes a second latent bug in the same step — the placeholder+
seddance it required used:sed -i "s|PLACEHOLDER|${FAILED_JOBS:-"- CI did not..."}|" ...nesting double quotes inside a double-quoted
sedexpression. The brace group needs no placeholder and nosed, so both problems disappear rather than being patched.The whole chain
GH_TOKENon a step gated to run only when a bump is duegh pr create --jqEvery one sat behind a gate that only opens when its predecessor is repaired. That is why months of green meant nothing — and it is the same shape as
yt-dlp-bump(nested gitlink → uppercase GHCR tag → swallowedghfailure → hardcodedx86_64deno).🤖 Generated with Claude Code