Skip to content

Commit daf03f8

Browse files
committed
set gh token outside workspace if gh is logged in
1 parent cb9f2d1 commit daf03f8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scripts/lib.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ gh_auth() {
144144
GITHUB_TOKEN=$(coder external-auth access-token github)
145145
export GITHUB_TOKEN
146146
fi
147+
elif token="$(gh auth token --hostname github.com 2>/dev/null)"; then
148+
export GITHUB_TOKEN=$token
147149
else
148150
log "Please authenticate gh CLI by running 'gh auth login'"
149151
fi

0 commit comments

Comments
 (0)