Skip to content

Commit

Permalink
one more try
Browse files Browse the repository at this point in the history
  • Loading branch information
tuantrannav committed Aug 2, 2023
1 parent 114702d commit 7ee88b7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions prepare-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ GITHUB_URL="https://api.github.com/repos/$GITHUB_REPOSITORY"
VERSION_TAG=$(TZ="Europe/Oslo" date +'%Y%m%d%H%M')
echo "VERSION_TAG=$VERSION_TAG" >> "$GITHUB_ENV"

if [ ! git describe --abbrev=0 --tags &>/dev/null ]; then
if [[ ! `git describe --abbrev=0 --tags` ]]; then
FIRST_COMMIT=$(git rev-list --max-parents=0 HEAD)
git tag "CD_autocreate_tag" $FIRST_COMMIT
echo "No tags found. Created one on the initial commit"
fi

LATEST_TAG=$(git describe --abbrev=0 --tags)


#git remote set-url origin "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
#git tag -f $VERSION_TAG
#git push -f --tags
git remote set-url origin "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git tag -f $VERSION_TAG
git push -f --tags


LATEST_RELEASE=$(curl -s -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$GITHUB_REPOSITORY/releases/latest" | jq -r '.tag_name')
Expand Down

0 comments on commit 7ee88b7

Please sign in to comment.