Skip to content

Fix issue with checking gem push exit code in release workflow#564

Merged
jeffcharles merged 2 commits intomainfrom
jc.fix-release-script
Feb 2, 2026
Merged

Fix issue with checking gem push exit code in release workflow#564
jeffcharles merged 2 commits intomainfrom
jc.fix-release-script

Conversation

@jeffcharles
Copy link
Collaborator

The last issue with the releases happened because of the way we evaluate non-zero exit conditions is slightly wrong.

If you run this bash script, you'll see that errcode is set to 0:

if ! /usr/bin/false; then
    errcode=$?
    echo $errcode
fi

whereas with this script, you'll see that errcode is set to 1:

/usr/bin/false || errcode=$?
if [ -n $errcode ]; then
    echo $errcode
fi

I think it's because the use of the ! operator inverts the value in $?.

Co-authored-by: Jimmy Bourassa <jbourassa@gmail.com>
@jeffcharles jeffcharles requested a review from jbourassa February 2, 2026 14:08
@jeffcharles jeffcharles merged commit 27dcbe5 into main Feb 2, 2026
16 checks passed
@jeffcharles jeffcharles deleted the jc.fix-release-script branch February 2, 2026 19:54
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