Skip to content

fix(rooms): tolerate gh nonzero exit under pipefail (CI rc=4 cascade) - #260

Merged
joelteply merged 1 commit into
canaryfrom
fix/cmd-rooms-tolerates-gh-no-auth
Apr 28, 2026
Merged

joelteply merged 1 commit into
canaryfrom
fix/cmd-rooms-tolerates-gh-no-auth

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

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.

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.
Copilot AI review requested due to automatic review settings April 28, 2026 23:43
@joelteply
joelteply merged commit 97da58d into canary Apr 28, 2026
@joelteply
joelteply deleted the fix/cmd-rooms-tolerates-gh-no-auth branch April 28, 2026 23:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 list so its non-zero exit does not abort the script under pipefail.
  • Ensure the “empty list” path is reached cleanly when gh output 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)
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.

2 participants