Skip to content

Commit

Permalink
Merge pull request #130 from szymonos/rfr/setup-gh-repos
Browse files Browse the repository at this point in the history
refactor(sh): setup_gh_repos - gh auth login
  • Loading branch information
szymonos authored Oct 5, 2023
2 parents 9dda674 + 6da2726 commit 9687cf5
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 9687cf5

Please sign in to comment.