Skip to content

Commit

Permalink
fix: token fix
Browse files Browse the repository at this point in the history
  • Loading branch information
xesrevinu committed Oct 10, 2024
1 parent af79b1d commit a7d0941
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,11 @@ function git_init() {
else
info "the source repository is located within GitHub."
if [[ "${SYNC_TOKEN}" ]]; then
# clear GITHUB_TOKEN
# backup GITHUB_TOKEN
export GITHUB_TOKEN_BAK="${GITHUB_TOKEN}"
unset GITHUB_TOKEN
gh auth login --with-token <<< "${SYNC_TOKEN}"
export GITHUB_TOKEN="${GITHUB_TOKEN_BAK}"
fi
gh auth setup-git --hostname "${source_repo_hostname}"
gh auth status --hostname "${source_repo_hostname}"
Expand Down
1 change: 1 addition & 0 deletions src/sync_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ function push () {
function switch_to_github_token_auth() {
info "Switching to GITHUB_TOKEN for authentication"
gh auth logout
info "logging in with GITHUB_TOKEN"
gh auth login --with-token <<< "${GITHUB_TOKEN}"
}

Expand Down

0 comments on commit a7d0941

Please sign in to comment.