Skip to content

Commit 5fb2317

Browse files
authored
chore(scripts): add custom gh auth to release script (#13396)
1 parent 9ae825e commit 5fb2317

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

scripts/release.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,18 @@ done
113113
# Check dependencies.
114114
dependencies gh jq sort
115115

116+
# Authenticate gh CLI.
117+
# NOTE: Coder external-auth won't work because the GitHub App lacks permissions.
118+
if [[ -z ${GITHUB_TOKEN:-} ]]; then
119+
if [[ -n ${GH_TOKEN:-} ]]; then
120+
export GITHUB_TOKEN=${GH_TOKEN}
121+
elif token="$(gh auth token --hostname github.com 2>/dev/null)"; then
122+
export GITHUB_TOKEN=${token}
123+
else
124+
error "GitHub authentication is required to run this command, please set GITHUB_TOKEN or run 'gh auth login'."
125+
fi
126+
fi
127+
116128
if [[ -z $increment ]]; then
117129
# Default to patch versions.
118130
increment="patch"

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy