-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a flag to disable adding labels to new pull requests (#1399)
Introduces the flag `--skip-labeling` that skips the application of labels to newly created pull requests (even if the `label` 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 the `github.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 the `label` 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.
- Loading branch information
Showing
6 changed files
with
44 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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