feat: add a flag to disable adding labels to new pull requests #1399
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.
Introduces the flag
--skip-labeling
that skips the application of labels to newly created pull requests (even if thelabel
option is set). We keep the label option set (e.g. to its default of['autorelease: pending']
) throughout the manifest logic so that it does not affect that logic or plugin logic, but then when it gets into thegithub.ts
layer we use the new flag to disable the additional API call that sets the labels after the pull request is created.This is needed for use cases that call the release-please CLI using a token (such as
YOSHI_CODE_BOT_TOKEN
) that does not have permissions on the repo. In such cases, the second call that sets labels on the newly created PR will fail from insufficient permissions, thus causing release-please to terminate with an error. Repos that run into this case (such as google-cloud-ruby) have other mechanisms to set the labels after release-please is finished. All we need is some way to prevent release-please from erroring out.I originally tried to handle this use case by passing an empty array using the
--label=
flag. This, however, fails because this value is used for other purposes in addition to setting the labels for new release PRs. For example, it is used to identify existing untagged release PRs. Thus, we cannot empty thelabel
option, and we must introduce some other means to tell release-please not to attempt to make the problematic PR edit call.Tested end-to-end locally.