Skip to content

Commit

Permalink
refactor(sh): setup_gh_repos - gh auth login
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonos committed Oct 5, 2023
1 parent 9dda674 commit 6da2726
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .assets/provision/setup_gh_repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ if ! grep -qw 'github.com' ~/.ssh/known_hosts 2>/dev/null; then
fi

# *check gh authentication status and login to GitHub if necessary
if gh auth status 2>&1 | grep -qw 'gh auth login'; then
gh auth login && github='https://github.com/'
fi
retry_count=0
while [[ true && $retry_count -lt 5 ]]; do
gh auth status 2>&1 | grep -qw 'Token: gho_' && github='https://github.com/' && break || true
gh auth login
((retry_count++))
done

# *setup source folder
# create folders
Expand Down

0 comments on commit 6da2726

Please sign in to comment.