diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index 579d2dd..aea3fce 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -39,8 +39,15 @@ jobs: - name: Get commit messages for the release id: get_commit_messages run: | - COMMITS=$(git log ${GITHUB_REF} --pretty=format:'- %s' | head -n 20) - echo "commits=$COMMITS" >> $GITHUB_ENV + LAST_TAG=$(git describe --tags --abbrev=0 $(git rev-list --tags --skip=1 --max-count=1) 2>/dev/null || echo "") + if [ -z "$LAST_TAG" ]; then + COMMITS=$(git log --pretty=format:'- %s' | head -n 20) + else + COMMITS=$(git log $LAST_TAG..HEAD --pretty=format:'- %s' | head -n 20) + fi + echo "commits<> $GITHUB_ENV + echo "$COMMITS" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV # Step 5: Upload the compiled PDF as a release asset - name: Upload PDF to Release