diff --git a/bump_version.sh b/bump_version.sh index 7b35fb9..f640f3f 100755 --- a/bump_version.sh +++ b/bump_version.sh @@ -41,11 +41,20 @@ git config --global user.email "github-actions@github.com" # Debug information echo "Setting remote URL with PAT_TOKEN" -echo "PAT_TOKEN: $PAT_TOKEN" +echo "PAT_TOKEN: ${#PAT_TOKEN}" # Set the remote URL with the PAT -git remote set-url origin https://${PAT_TOKEN}@github.com/tawanda-kembo/code-collator.git +git remote set-url origin "https://${PAT_TOKEN}@github.com/tawanda-kembo/code-collator.git" # Create a new tag git tag "v$NEW_VERSION" -git push origin "v$NEW_VERSION" \ No newline at end of file + +# Push the tag using the PAT +GIT_ASKPASS=$(mktemp) +echo "echo \$PAT_TOKEN" > $GIT_ASKPASS +chmod +x $GIT_ASKPASS + +GIT_HTTP_USER_AGENT="git/2.29.0" GIT_ASKPASS=$GIT_ASKPASS git push origin "v$NEW_VERSION" + +# Clean up +rm $GIT_ASKPASS \ No newline at end of file