fix: close captured output before returning failures - #413
Open
MikeeI wants to merge 1 commit into
Open
Conversation
A nonzero drone-ssh pipeline previously exited under errexit before writing the closing GITHUB_OUTPUT delimiter. Capture the pipefail status inside an if condition, finish the record, then return that status. Add a separator only when stdout lacks a final newline so successful captured values retain their existing shape.
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.
Summary
With
capture_stdout: true, a nonzerodrone-ssh | teepipeline exits underset -euo pipefailbefore the closingGITHUB_OUTPUTdelimiter is written.This change records the pipeline status, completes the output record, and returns that status afterward.
Evidence
entrypoint.shon the current base opens the multiline value and executes the pipeline before writing its closing delimiter.Matching delimiter not found 'EOF'and unavailable captured output after a nonzero remote command.payloadwithout a final newline and exited 17 reproduced exit 17 with the unterminated recordstdout<<EOF\npayload.Changes
ifcondition so strict mode does not skip output-record cleanup.pipefailstatus and return it only after the closing delimiter is written.Risks and boundaries
EOF; delimiter collision is intentionally outside this pull request.Verification
bash -n entrypoint.sh && shellcheck entrypoint.sh && git diff --check— passed.payloadwithout a final newline and exits 17 — the entrypoint exits 17 and writes one completestdoutrecord.I checked the relevant issues, comments, pull requests, discussions, and releases; this pull request is not a duplicate.
Disclosure
Investigated thoroughly with GPT-5.6 Codex (high reasoning effort), using Oh My Pi as the agent framework.
This report is not generic or unreviewed AI-generated output. Its claims were checked against the cited evidence, and it includes the relevant detail intended to help maintainers resolve the issue.
If reports like this are not useful to the project, please let me know and I will refrain from submitting similar ones. My intent is to help without wasting maintainer time or energy or discouraging their work.
Thank you for your work.