Skip to content

Commit ca64877

Browse files
committed
feat: test2
1 parent 1ff7182 commit ca64877

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,18 @@ jobs:
9090
- name: Create Manual Instructions
9191
id: manual_notes
9292
run: |
93-
VERSION="${{ github.event.inputs.version }}"
93+
# 1. Handle Versioning (Input vs Tag)
94+
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
95+
VERSION="${{ github.event.inputs.version }}"
96+
TARGET_COMMIT="${{ github.sha }}"
97+
else
98+
VERSION="${GITHUB_REF#refs/tags/}"
99+
TARGET_COMMIT="${VERSION}"
100+
fi
101+
94102
FILE_NAME="manual_notes.md"
95-
96-
# Get previous tag or default to first commit
103+
104+
# 2. Get previous tag. If none exists, get the first commit
97105
PREV_TAG=$(git describe --tags --abbrev=0 "${VERSION}^" 2>/dev/null || git rev-list --max-parents=0 HEAD)
98106
99107
REPO_URL="https://github.com/${{ github.repository }}"
@@ -135,15 +143,13 @@ jobs:
135143
136144
EOF
137145
138-
if [ -n "$PREV_TAG" ]; then
139-
git log ${PREV_TAG}..${VERSION} --oneline --pretty=format:"* %s (%h)" >> ${FILE_NAME}
140-
else
141-
echo "Initial release" >> ${FILE_NAME}
142-
fi
146+
# 3. Generate changelog between previous tag and current commit
147+
git log ${PREV_TAG}..${TARGET_COMMIT} --oneline --pretty=format:"* %s (%h)" >> ${FILE_NAME}
143148
144149
- name: Publish Release
145150
uses: softprops/action-gh-release@v1
146151
with:
152+
tag_name: ${{ github.event.inputs.version || github.ref_name }}_
147153
body_path: manual_notes.md
148154
append_body: true # ✅ This attaches GitHub's notes BELOW yours
149155
generate_release_notes: true # ✅ This triggers the auto-generation

0 commit comments

Comments
 (0)