diff --git a/changelog.d/19035.misc b/changelog.d/19035.misc new file mode 100644 index 00000000000..a6679190453 --- /dev/null +++ b/changelog.d/19035.misc @@ -0,0 +1 @@ +Allow any command of the `release.py` to accept a `--gh-token` argument. \ No newline at end of file diff --git a/scripts-dev/release.py b/scripts-dev/release.py index 73a4e7b7a9d..a7e967116e3 100755 --- a/scripts-dev/release.py +++ b/scripts-dev/release.py @@ -639,7 +639,16 @@ def _notify(message: str) -> None: @cli.command() -def merge_back() -> None: +# Although this option is not used, allow it anyways. Otherwise the user will +# receive an error when providing it, which is annoying as other commands accept +# it. +@click.option( + "--gh-token", + "_gh_token", + envvar=["GH_TOKEN", "GITHUB_TOKEN"], + required=False, +) +def merge_back(_gh_token: Optional[str]) -> None: _merge_back() @@ -687,7 +696,16 @@ def _merge_back() -> None: @cli.command() -def announce() -> None: +# Although this option is not used, allow it anyways. Otherwise the user will +# receive an error when providing it, which is annoying as other commands accept +# it. +@click.option( + "--gh-token", + "_gh_token", + envvar=["GH_TOKEN", "GITHUB_TOKEN"], + required=False, +) +def announce(_gh_token: Optional[str]) -> None: _announce()