-
-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Enhance release notes generation with optional tag input and workflow adjustments #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
c272beb
2f646ef
39b7303
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2,8 +2,13 @@ name: Generate Release Notes | |||||||||||||
|
|
||||||||||||||
| on: | ||||||||||||||
| release: | ||||||||||||||
| types: [published, prereleased, released, created] | ||||||||||||||
| types: [published, prereleased, created] | ||||||||||||||
| workflow_dispatch: | ||||||||||||||
| workflow_call: | ||||||||||||||
| inputs: | ||||||||||||||
| tag: | ||||||||||||||
|
||||||||||||||
| tag: | |
| tag: | |
| description: 'Release tag to generate notes for. If not provided, uses the release event tag or the most recent tag.' |
Outdated
Copilot
AI
Nov 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic has redundancy that could be simplified. Lines 55-57 and 60-62 have identical fallback logic. The condition on line 55 will never be true when line 60 is reached because if TAG_NAME is empty and the event is workflow_dispatch, it will be set on line 56, making the second fallback unreachable for that specific case.
Consider simplifying to:
TAG_NAME="${{ inputs.tag }}"
if [[ -z "${TAG_NAME}" && "${{ github.event_name }}" == "release" ]]; then
TAG_NAME="${{ github.event.release.tag_name }}"
fi
# Fallback to most recent tag for workflow_dispatch, workflow_call, or if tag not provided/resolved
if [[ -z "${TAG_NAME}" ]]; then
TAG_NAME="$(git tag --sort=-creatordate | head -n 1 || true)"
fi| if [[ -z "${TAG_NAME}" && "${{ github.event_name }}" == "workflow_dispatch" ]]; then | |
| TAG_NAME="$(git tag --sort=-creatordate | head -n 1 || true)" | |
| fi | |
| # Fallback for workflow_call or any other trigger if tag was not provided/resolved | |
| # Fallback to most recent tag for workflow_dispatch, workflow_call, or if tag not provided/resolved |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
release-notesjob will run even when thereleasejob is skipped due to the conditionif: startsWith(github.ref, 'refs/tags/'). When triggered byworkflow_dispatchwithout a tag (wheregithub.refwould be a branch), thereleasejob will be skipped, butrelease-noteswill still attempt to run and call the release-notes-generator workflow.Consider adding the same condition to the
release-notesjob: