-
Notifications
You must be signed in to change notification settings - Fork 3.8k
GH-47075: [Release][Dev] Use GH_TOKEN as GitHub token environment variable #47181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
da363b6
to
96e0eb1
Compare
…nt variable We can still use `ARROW_GITHUB_API_TOKEN` and `CROSSBOW_GITHUB_TOKEN` for backward compatibility but `GH_TOKEN` is recommended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, thanks @kou. I left some comments.
Should we update this comment in .env.example too?
diff --git a/dev/release/.env.example b/dev/release/.env.example
index c1e012aacb..43af2851db 100644
--- a/dev/release/.env.example
+++ b/dev/release/.env.example
@@ -31,7 +31,7 @@
# You must set this.
#ARTIFACTORY_API_KEY=secret
-# The GitHub token to upload artifacts to GitHub Release.
+# The GitHub token used in numerous release scripts.
#
# You must set this.
#GH_TOKEN=secret
@@ -254,10 +255,13 @@ def __init__(self, project_name, cmd): | |||
config = load_configuration() | |||
if "github" in config.sections(): | |||
token = config["github"]["api_token"] | |||
if not token: | |||
token = os.environ.get('GH_TOKEN') | |||
if not token: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to warn people they're still using ARROW_GITHUB_API_TOKEN
to allow us to fully deprecate it at some point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I've added warning message.
Co-authored-by: Bryce Mecum <petridish@gmail.com>
CROSSBOW_GITHUB_TOKEN is for ursacomputing/crossbow and GH_TOKEN is for apache/arrow. We may want to use different token for them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion. I've updated the comment in .env.example
.
@@ -254,10 +255,13 @@ def __init__(self, project_name, cmd): | |||
config = load_configuration() | |||
if "github" in config.sections(): | |||
token = config["github"]["api_token"] | |||
if not token: | |||
token = os.environ.get('GH_TOKEN') | |||
if not token: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I've added warning message.
I'll merge this. |
Thanks for your work on this @kou. |
Rationale for this change
We have many environment variables for GitHub token:
GH_TOKEN
,ARROW_GITHUB_API_TOKEN
andCROSSBOW_GITHUB_TOKEN
It's difficult to maintain. For example, we may forget to define one of them.
What changes are included in this PR?
Use
GH_TOKEN
as unified environment variable for GitHub token.We can still use
ARROW_GITHUB_API_TOKEN
andCROSSBOW_GITHUB_TOKEN
for backward compatibility butGH_TOKEN
is recommended.Are these changes tested?
Yes.
Are there any user-facing changes?
No.