Skip to content

Commit

Permalink
Update entrypoint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 authored Mar 10, 2023
1 parent f23c4af commit ac0218f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ if [[ $GITHUB_REF != "refs/tags/"* ]]; then
exit 0;
fi

git fetch "$INPUTS_REMOTE" +refs/tags/*:refs/tags/*
GITHUB_HOST=${GITHUB_SERVER_URL#https://}
REMOTE_URL=https://$INPUTS_TOKEN@$GITHUB_HOST/$GITHUB_REPOSITORY

echo "Remote URL: $REMOTE_URL"

git fetch "$REMOTE_URL" +refs/tags/*:refs/tags/*

NEW_TAG=${GITHUB_REF/refs\/tags\//}
MAJOR_VERSION=$(echo "$NEW_TAG" | cut -d. -f1)
Expand Down Expand Up @@ -38,7 +43,7 @@ if [[ -f "$INPUTS_RELEASE_NOTES_FILE" ]]; then

# Re-tag the major version using the latest tag
git tag -f "$MAJOR_VERSION" "$NEW_TAG"
git push -f "$INPUTS_REMOTE" "$MAJOR_VERSION"
git push -f "$REMOTE_URL" "$MAJOR_VERSION"
else
if [[ -n "$(find "$RELEASE_ASSETS_DIR" -type f)" ]]; then
gh release create "$MAJOR_VERSION" --notes-file "$INPUTS_RELEASE_NOTES_FILE" --title "$MAJOR_VERSION" "$RELEASE_ASSETS_DIR"/*
Expand Down

0 comments on commit ac0218f

Please sign in to comment.