Skip to content

chore(scripts): add custom gh auth to release script #13396

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

Merged
merged 1 commit into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
chore(scripts): add custom gh auth to release script
  • Loading branch information
mafredri committed May 29, 2024
commit 11bd174d2bc134660a9cd7825c375b37cf4965c1
12 changes: 12 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,18 @@ done
# Check dependencies.
dependencies gh jq sort

# Authenticate gh CLI.
# NOTE: Coder external-auth won't work because the GitHub App lacks permissions.
if [[ -z ${GITHUB_TOKEN:-} ]]; then
if [[ -n ${GH_TOKEN:-} ]]; then
export GITHUB_TOKEN=${GH_TOKEN}
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

if [[ -z $increment ]]; then
# Default to patch versions.
increment="patch"
Expand Down
Loading