Skip to content

Commit c140f14

Browse files
author
Tajudeen
committed
use authentical url
1 parent 202d8d9 commit c140f14

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

update_version.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,12 @@ updateLatestVersion() {
142142
echo "${JSON_DATA}"
143143
}
144144

145-
# init versions repo for later commiting + pushing the json file to it
146-
# thank you https://www.vinaygopinath.me/blog/tech/commit-to-master-branch-on-github-using-travis-ci/
147-
git clone "https://${GH_HOST}/${VERSIONS_REPOSITORY}.git"
145+
# init versions repo for later committing + pushing the json file to it
146+
# Use authenticated clone to avoid interactive credential prompts in CI
147+
git clone "https://${GITHUB_USERNAME}:${GITHUB_TOKEN}@${GH_HOST}/${VERSIONS_REPOSITORY}.git" 2>/dev/null || {
148+
echo "Authenticated clone failed; falling back to unauthenticated clone (may fail for private repos)";
149+
git clone "https://${GH_HOST}/${VERSIONS_REPOSITORY}.git";
150+
}
148151
cd "${REPOSITORY_NAME}" || { echo "'${REPOSITORY_NAME}' dir not found"; exit 1; }
149152
git config user.email "$( echo "${GITHUB_USERNAME}" | awk '{print tolower($0)}' )-ci@not-real.com"
150153
git config user.name "${GITHUB_USERNAME} CI"

0 commit comments

Comments
 (0)