Skip to content

Commit 586aecf

Browse files
committed
ci: Improve release.yaml, take 5
1 parent 7d8b181 commit 586aecf

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,21 @@ jobs:
119119
- name: Generate release notes
120120
id: release_notes
121121
run: |
122-
# Get repository name from GitHub context
123-
REPO_NAME="${{ github.event.repository.name }}"
122+
# Extract project name from first H1 heading in README.md
123+
PROJECT_NAME=$(grep -m 1 '^# ' README.md | sed 's/^# //')
124+
125+
# Fall back to repo name if not found
126+
if [ -z "$PROJECT_NAME" ]; then
127+
PROJECT_NAME="${{ github.event.repository.name }}"
128+
fi
129+
124130
REPO_URL="https://github.com/${{ github.repository }}"
125131
126132
# Use the previous tag we captured before creating the new tag
127133
PREV_TAG="${{ steps.prev_tag.outputs.prev_tag }}"
128134
129135
echo "notes<<EOF" >> $GITHUB_OUTPUT
130-
echo "## ${REPO_NAME} ${{ inputs.version }}" >> $GITHUB_OUTPUT
136+
echo "## ${PROJECT_NAME} ${{ inputs.version }}" >> $GITHUB_OUTPUT
131137
echo "" >> $GITHUB_OUTPUT
132138
133139
# Add user-provided description if present

0 commit comments

Comments
 (0)