Add a new CLI flag to allow the user to specify a custom exit code#67
Merged
dannyvv merged 4 commits intomicrosoft:mainfrom May 9, 2025
Merged
Add a new CLI flag to allow the user to specify a custom exit code#67dannyvv merged 4 commits intomicrosoft:mainfrom
dannyvv merged 4 commits intomicrosoft:mainfrom
Conversation
exit code that gets returned when ado-npm-auth had to re-authenticate. This is useful when one uses a prerelease step to call ado-npm-auth after which yarn has already parsed the configuration and tokens. So the first time the install will fail with a 401, but the second time it will work. This way a prerelease script can be used to make sure yarn is stopped and asked to rerun..
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new CLI flag (exitCodeOnReAuthenticate) that allows users to specify a custom exit code when ado-npm-auth undergoes re-authentication.
- Added a process.exit call in cli.ts to handle the exit code if the flag is provided.
- Updated the argument parsing in args.ts to support the new CLI flag.
- Recorded the change in the change log JSON to document the update.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| packages/ado-npm-auth/src/cli.ts | Added flag check and process.exit call on successful auth |
| packages/ado-npm-auth/src/args.ts | Integrated new CLI flag in argument parsing |
| change/change-72abf428-c4ea-439b-bc1e-4f77dc37ce7d.json | Documented the change in the change log |
Co-authored-by: Copilot <[email protected]>
NikoAri
approved these changes
May 9, 2025
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.
Add a new CLI flag to allow the user to specify a custom exit code that gets returned when ado-npm-auth had to re-authenticate. This is useful when one uses a prerelease step to call ado-npm-auth after which yarn has already parsed the configuration and tokens. So the first time the install will fail with a 401, but the second time it will work. This way a prerelease script can be used to make sure yarn is stopped and asked to rerun.