Skip to content

Commit

Permalink
feat(github-actions): enhance script to handle initial release tagging
Browse files Browse the repository at this point in the history
The tag_after_test workflow has been updated to support tagging of initial
releases when no previous tag exists. This change ensures that the
CHANGELOG includes all commits since the beginning of the project by
modifying the git log command to include the '--all' option. Additionally,
use of echo statements for LATEST_TAG and NEXT_TAG has been added for
better debug gability.
  • Loading branch information
godcong committed Jul 10, 2024
1 parent a3df4a7 commit ebe1b8c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/tag_after_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
run: |
chmod +x ./scripts/git/commit_tag.sh
LATEST_TAG=$(./scripts/git/commit_tag.sh)
echo "LATEST_TAG=$LATEST_TAG"
if [[ -z "$LATEST_TAG" ]]; then
NEXT_TAG="v0.0.1"
else
Expand All @@ -60,6 +61,7 @@ jobs:
PATCH=${VERSION_ARRAY[2]}
(( PATCH++ ))
NEXT_TAG=v$MAJOR.$MINOR.$PATCH
echo "NEXT_TAG=$NEXT_TAG"
echo "NEXT_TAG=$NEXT_TAG" >> $GITHUB_OUTPUT
fi
Expand All @@ -69,7 +71,8 @@ jobs:
LATEST_RELEASE=${{ steps.get_latest_release.outputs.LATEST_RELEASE }}
if [[ -z "$LATEST_RELEASE" ]]; then
# If no release, start from the first commit
CHANGELOG=$(git log --pretty=format:"* %s (%an, %ar)" --reverse)
# Use --all to get all commits, even before the first one
CHANGELOG=$(git log --all --pretty=format:"* %s (%an, %ar)" --reverse)
else
# Get all submission information since the last release
CHANGELOG=$(git log "$LATEST_RELEASE"..HEAD --pretty=format:"* %s (%an, %ar)")
Expand Down

0 comments on commit ebe1b8c

Please sign in to comment.