Skip to content

Commit d440cfc

Browse files
Allow any release script command to accept --gh-token (#19035)
1 parent 18f07fd commit d440cfc

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

changelog.d/19035.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Allow any command of the `release.py` to accept a `--gh-token` argument.

scripts-dev/release.py

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,16 @@ def _notify(message: str) -> None:
639639

640640

641641
@cli.command()
642-
def merge_back() -> None:
642+
# Although this option is not used, allow it anyways. Otherwise the user will
643+
# receive an error when providing it, which is annoying as other commands accept
644+
# it.
645+
@click.option(
646+
"--gh-token",
647+
"_gh_token",
648+
envvar=["GH_TOKEN", "GITHUB_TOKEN"],
649+
required=False,
650+
)
651+
def merge_back(_gh_token: Optional[str]) -> None:
643652
_merge_back()
644653

645654

@@ -687,7 +696,16 @@ def _merge_back() -> None:
687696

688697

689698
@cli.command()
690-
def announce() -> None:
699+
# Although this option is not used, allow it anyways. Otherwise the user will
700+
# receive an error when providing it, which is annoying as other commands accept
701+
# it.
702+
@click.option(
703+
"--gh-token",
704+
"_gh_token",
705+
envvar=["GH_TOKEN", "GITHUB_TOKEN"],
706+
required=False,
707+
)
708+
def announce(_gh_token: Optional[str]) -> None:
691709
_announce()
692710

693711

0 commit comments

Comments
 (0)