Skip to content

Commit dac3409

Browse files
Copilotesnya
andcommitted
Improve release workflow tag detection and release notes handling
- Add explicit check for tag push events to avoid ambiguity - Only auto-generate release notes for tag pushes, not for UI-created releases - Add error handling for unexpected event types - Add comments explaining the behavior for different trigger types Co-authored-by: esnya <2088693+esnya@users.noreply.github.com>
1 parent 853f474 commit dac3409

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,21 @@ jobs:
146146
run: |
147147
if [ "${{ github.event_name }}" = "release" ]; then
148148
echo "tag_name=${{ github.event.release.tag_name }}" >> "$GITHUB_OUTPUT"
149-
else
149+
elif [[ "${{ github.ref }}" == refs/tags/* ]]; then
150150
echo "tag_name=${{ github.ref_name }}" >> "$GITHUB_OUTPUT"
151+
else
152+
echo "::error::Unexpected event: ${{ github.event_name }} with ref: ${{ github.ref }}"
153+
exit 1
151154
fi
152155
153156
- name: Publish GitHub release
154157
uses: softprops/action-gh-release@v2
155158
with:
156159
tag_name: ${{ steps.tag.outputs.tag_name }}
157160
name: While Loop Timeout ${{ steps.tag.outputs.tag_name }}
158-
generate_release_notes: true
161+
# When triggered by release event, this updates the existing release
162+
# When triggered by tag push, this creates a new release
163+
generate_release_notes: ${{ github.event_name != 'release' }}
159164
files: |
160165
release-artifacts/WhileLoopTimeout.dll
161166
release-artifacts/WhileLoopTimeout.pdb

0 commit comments

Comments
 (0)