Support --no-repos-selected
on gh secret set
#11217
Merged
+163
−39
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.
Description
Fixes #9808
Acceptance Criteria
Given there is no secret
When I run
gh secret set <secret_name> -b <secret_value> -o <org> -v selected --no-repos-selected
Then a secret called <secret_name> is created in with a value of <secret_value> with the selected visibility and no repositories selected.
Given there is an existing secret with <secret_name>
When I run
gh secret set <secret_name> -b <secret_value> -o <org> -v selected --no-repos-selected
Then that secret is replaced with a value of <secret_value> with the selected visibility and no repositories selected.
When I run
gh secret set <secret_name> -b <secret_value> -o <org> -v selected --no-repos-selected --repos
Then then I receive an error message indicating the mutual exclusivity of the --no-repos-selected and --repos flags
When I run
gh secret set <secret_name> -b <secret_value> -o <org> --no-repos-selected
Then then --visibility selected is implied
When I run
gh secret set <secret_name> -b <secret_value> -o <org> -v <private/all> --no-repos-selected
Then then I receive an error message indicating that --no-repos-selected may only be used with --visibility selected
When I run
gh secret set <secret_name> -b <secret_value> -o <org> -v selected
Then then I receive an error message indicating that providing either a list of repos with --repos or --no-repo-selected is required.
When I run
gh secret set --help
Then then there is a note about --no-repos-selected that indicates if there are any repos selected on an existing secret, then they will be cleared.A
Acceptance Test