From a28d873323c3f63d3a9c2a201b3afb2b21a52f32 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 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index e107bb6..70c246c 100644 --- a/action.yml +++ b/action.yml @@ -49,11 +49,15 @@ 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" + gitea_url="${GITHUB_SERVER_URL#https://}" # Remove HTTPS + log_info "Overriding git repository auth with PAT" + echo "https://Skydust:${{ secrets.CI_GIT_WRITE_TOKEN }}@${gitea_url}" > .git-credentials + cat .git-credentials + git config credential.helper store + git config --local --unset http.https://${gitea_url}/.extraheader + + log_info "Pushing new tag" git fetch git tag -a "v${NEW_VERSION}" -m "Release version ${NEW_VERSION}" git push origin "v${NEW_VERSION}"