Add write to netrc for gitlab credential

This commit is contained in:
bkellam 2024-09-04 14:23:50 -07:00
parent ac3e8313b3
commit 8a94732296
2 changed files with 7 additions and 1 deletions

View file

@ -3,7 +3,7 @@
"Configs": [
{
"Type": "github",
"GitHubUser": "TaqlaAI"
"GitHubOrg": "TaqlaAI"
},
{
"Type": "gitlab",

View file

@ -17,6 +17,12 @@ fi
if [ -n "$GITLAB_TOKEN" ]; then
echo "$GITLAB_TOKEN" > "$HOME/.gitlab-token"
chmod 600 "$HOME/.gitlab-token"
# Configure Git with the provided GITLAB_TOKEN
echo "machine gitlab.com
login oauth
password ${GITLAB_TOKEN}" > "$HOME/.netrc"
chmod 600 "$HOME/.netrc"
else
echo -e "\e[33mWarning: GitLab repositories will not be indexed since GITLAB_TOKEN was not set. If you are not using GitLab, disregard.\e[0m"
fi