Repository navigation
fix(rooms): tolerate gh nonzero exit under pipefail (CI rc=4 cascade) - #260
Merged
Merged
Conversation
CI integration-suite failed with 'airc list crashed (rc=4)' on canary
push. Root cause: airc has `set -euo pipefail`. `gh gist list`
exits 4 when not authed (CI runners have no gh auth). Under pipefail
the whole pipeline propagates the failure; -e then aborts the script
with rc=4. Cascaded: subsequent integration scenarios saw side
effects from the aborted process.
## Fix
Wrap the gh call in `{ ... || true; }` so unauthed gh produces empty
output instead of failing the pipeline. The downstream count=0 branch
already handles 'no rooms found' cleanly; this just lets it run.
Verification: tabs 19/0; manual airc list with gh present works
unchanged.
There was a problem hiding this comment.
Pull request overview
This PR updates the airc list/rooms/ls implementation to avoid crashing under set -euo pipefail when gh gist list exits non-zero (notably exit code 4 when unauthenticated), which was cascading into CI failures.
Changes:
- Wrap
gh gist listso its non-zero exit does not abort the script underpipefail. - Ensure the “empty list” path is reached cleanly when
ghoutput can’t be obtained (e.g., unauthed in CI).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # gh gist list columns: id description files visibility updated_at | ||
| local raw; raw=$(gh gist list --limit 50 2>/dev/null \ | ||
| # | ||
| # CI fix: airc has \`set -euo pipefail\` at the top. \`gh gist list\` exits |
Comment on lines
+75
to
+81
| local raw="" | ||
| raw=$( { gh gist list --limit 50 2>/dev/null || true; } \ | ||
| | awk -F'\t' ' | ||
| /airc mesh/ { print "mesh\t" $1 "\t" $2 "\t" $5 } | ||
| /airc room:/ { print "room\t" $1 "\t" $2 "\t" $5 } | ||
| /airc invite for/ { print "invite\t" $1 "\t" $2 "\t" $5 } | ||
| ') | ||
| ' || true) |
This was referenced Apr 28, 2026
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.
set -euo pipefail + gh exits 4 on no-auth = airc list crashes rc=4 in CI. Wrap the gh call so unauthed gh produces empty output cleanly.