- Notifications
You must be signed in to change notification settings - Fork928
chore(scripts): fix stable release promote script#13204
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
cb9f2d1
daf03f8
9417866
a3b254d
7573dfc
e7276be
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -134,18 +134,22 @@ requiredenvs() { | ||
} | ||
gh_auth() { | ||
if [[ -z ${GITHUB_TOKEN:-} ]]; then | ||
if [[ -n ${GH_TOKEN:-} ]]; then | ||
Comment on lines +137 to +138 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. We should always get the new token. The token stored in
| ||
export GITHUB_TOKEN=${GH_TOKEN} | ||
elif [[ ${CODER:-} == true ]]; then | ||
if ! output=$(coder external-auth access-token github 2>&1); then | ||
# TODO(mafredri): We could allow checking `gh auth token` here. | ||
log "${output}" | ||
error "Could not authenticate with GitHub using Coder external auth." | ||
else | ||
export GITHUB_TOKEN=${output} | ||
fi | ||
elif token="$(gh auth token --hostname github.com 2>/dev/null)"; then | ||
export GITHUB_TOKEN=${token} | ||
else | ||
error "GitHub authentication is required to run this command, please set GITHUB_TOKEN or run 'gh auth login'." | ||
fi | ||
fi | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -4,6 +4,9 @@ set -euo pipefail | ||
# shellcheck source=scripts/lib.sh | ||
source"$(dirname"${BASH_SOURCE[0]}")/lib.sh" | ||
# Make sure GITHUB_TOKEN is set for the release command. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This only works when There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Do we suggest adding an extra "echo" to indicate it? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. That’s the expected use-case. And if it isn’t set outside a workspace it’ll print a notice to do There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Perhaps we also shouldn't override GITHUB_TOKEN if it's set? And maybe support GH_TOKEN too (in lib.sh)? Thoughts@matifali? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Yes as far it works and make it more robust. Let's do this. I don't fully understand the difference between There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. | ||
gh_auth | ||
# This script is a convenience wrapper around the release promote command. | ||
# | ||
# Sed hack to make help text look like this script. | ||
Uh oh!
There was an error while loading.Please reload this page.