Repository navigation
Exit with code 1 when CLI credentials are missing - #251
Open
pablotransifex wants to merge 1 commit into
Open
pablotransifex wants to merge 1 commit into
pablotransifex wants to merge 1 commit into
Conversation
push, pull and invalidate exited with code 0 after reporting missing credentials, so CI jobs passed while nothing was pushed or pulled. Fixes #226
pablotransifex
force-pushed
the
fix/cli-exit-code-on-missing-credentials
branch
from
November 11, 2026 15:57
1751e12 to
6885985
Compare
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.
Fixes #226.
txjs-cli push,pullandinvalidateprinted "credentials are missing" and then calledprocess.exit(), which exits with code 0. A CI job with wiped credentials therefore stayed green while nothing was pushed.All three now call
this.exit(1). It sets the same exit code asprocess.exit(1), but oclif throws instead of killing the process, so tests can assert on it. Thepush"Nothing to upload" path still exits with 0, because an empty push is not a failure.Tests: I added a missing-credentials test to each command that expects exit code 1. Without the fix, the old
process.exit()kills mocha in the middle of the run. With the fix, the full CLI suite passes (56 tests). Running./bin/run push|pull|invalidatewith emptyTRANSIFEX_TOKEN/TRANSIFEX_SECRETexits with 1.Release note: scripts that relied on exit code 0 here will now see a failure, which is the purpose of this fix.