From ac689e829e784a2bd504b4b0a10b7691f4211111 Mon Sep 17 00:00:00 2001 From: Skydust Date: Wed, 25 Dec 2024 16:57:19 +0100 Subject: [PATCH] Fixing git push --- action.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index e107bb6..06243e4 100644 --- a/action.yml +++ b/action.yml @@ -49,11 +49,19 @@ runs: git config user.email "release@example.com" git config user.name "Release" - original_url="$(git remote get-url origin)" - repo_url="${original_url#https://}" # Remove HTTPS - new_url="https://x-access-token:${{ secrets.CI_GIT_WRITE_TOKEN }}@$repo_url" - git remote set-url origin "$new_url" + repo_url="$(git remote get-url origin)" + # GITHUB_SERVER_URL + repo_url="${repo_url#https://}" # Remove HTTPS + log_info "Overriding git repository auth with PAT" + + GIT_NEW_URL="https://Skydust:a891a30bb53be39a93376d63e0c78eb4783f33d1@${repo_url}.git" + git remote set-url origin "$GIT_NEW_URL" + log_info "Url $GIT_NEW_URL" + git config --local --unset http.https://${GITHUB_SERVER_URL#https://}/.extraheader + log_i + + log_info "Pushing new tag" git fetch git tag -a "v${NEW_VERSION}" -m "Release version ${NEW_VERSION}" git push origin "v${NEW_VERSION}"