Skip to content

Commit c272beb

Browse files
feat: Enhance release notes generation with optional tag input and workflow adjustments
1 parent fb3ad66 commit c272beb

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

.github/workflows/release-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,3 +379,10 @@ jobs:
379379
prerelease: false
380380
env:
381381
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
382+
383+
release-notes:
384+
needs: release
385+
uses: ./.github/workflows/release-notes-generator.yml
386+
with:
387+
tag: ${{ github.ref_name }}
388+
secrets: inherit

.github/workflows/release-notes-generator.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@ name: Generate Release Notes
22

33
on:
44
release:
5-
types: [published, prereleased, released, created]
5+
types: [published, prereleased, created]
66
workflow_dispatch:
7+
workflow_call:
8+
inputs:
9+
tag:
10+
required: false
11+
type: string
712

813
permissions:
914
contents: write
@@ -42,10 +47,12 @@ jobs:
4247
run: |
4348
set -euo pipefail
4449
45-
if [[ "${{ github.event_name }}" == "release" ]]; then
50+
TAG_NAME="${{ inputs.tag }}"
51+
if [[ -z "${TAG_NAME}" && "${{ github.event_name }}" == "release" ]]; then
4652
TAG_NAME="${{ github.event.release.tag_name }}"
47-
else
48-
# workflow_dispatch - use most recent tag by creation date
53+
fi
54+
55+
if [[ -z "${TAG_NAME}" && "${{ github.event_name }}" == "workflow_dispatch" ]]; then
4956
TAG_NAME="$(git tag --sort=-creatordate | head -n 1 || true)"
5057
fi
5158

0 commit comments

Comments
 (0)