Skip to content

Commit

Permalink
Merge pull request #6 from tawanda-kembo/feat/automate-versioning
Browse files Browse the repository at this point in the history
chore: fix PAT_TOKEN usage in GitHub Actions workflow
  • Loading branch information
tawandakembo authored Jul 27, 2024
2 parents 706c465 + 4b979d8 commit 0255734
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions bump_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,20 @@ git config --global user.email "[email protected]"

# 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"

# 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

0 comments on commit 0255734

Please sign in to comment.