-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: fix PAT_TOKEN usage in GitHub Actions workflow
- Loading branch information
1 parent
086d03d
commit 1e3a1fb
Showing
2 changed files
with
7 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,25 +35,20 @@ esac | |
|
||
NEW_VERSION="$MAJOR.$MINOR.$PATCH" | ||
|
||
# Configure git to use the PAT | ||
# Configure git to use the GITHUB_TOKEN | ||
git config --global user.name "github-actions" | ||
git config --global user.email "[email protected]" | ||
|
||
# Debug information | ||
echo "Setting remote URL with 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" | ||
# Set the remote URL with the GITHUB_TOKEN | ||
git remote set-url origin "https://${GITHUB_TOKEN}@github.com/tawanda-kembo/code-collator.git" | ||
|
||
# Create a new tag | ||
git tag "v$NEW_VERSION" | ||
|
||
# Push the tag using the PAT | ||
# Push the tag using the GITHUB_TOKEN | ||
GIT_ASKPASS=$(mktemp) | ||
echo "echo \$PAT_TOKEN" > $GIT_ASKPASS | ||
echo "echo \$GITHUB_TOKEN" > $GIT_ASKPASS | ||
chmod +x $GIT_ASKPASS | ||
|
||
GIT_ASKPASS=$GIT_ASKPASS git push origin "v$NEW_VERSION" | ||
|
||
# Clean up | ||
|