Skip to content

Commit 2ec13e0

Browse files
github-actions[bot]actions-userMishaKav
authored
improve GitHub release workflow [skip ci] (#400)
* bump @linearb/gitstream-core to 2.1.207 * fix: update PR title formatting and enhance release notes generation logic * fix: update version number in workflow input description and default value --------- Co-authored-by: GitHub Actions Bot <actions@github.com> Co-authored-by: Misha Kav <misha.kav@gmail.com>
1 parent 59f7e8b commit 2ec13e0

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

.github/workflows/bump-gitstream-core.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ on:
66
workflow_dispatch:
77
inputs:
88
version:
9-
description: Version number (ex. "2.1.133")
9+
description: Version number (ex. "2.1.207")
1010
required: true
11-
default: 2.1.133
11+
default: 2.1.207
1212
ticket:
1313
description: LINBEE-XXXXX ticket number
1414
default: LINBEE-8514
@@ -71,6 +71,6 @@ jobs:
7171
git push origin HEAD:${{ env.BRANCH_NAME }}
7272
gh pr create \
7373
--base develop \
74-
--title "Bump `@linearb/gitstream-core` to `${{ env.VERSION }}`" \
74+
--title "Bump \`@linearb/gitstream-core\` to \`${{ env.VERSION }}\`" \
7575
--body-file pr_description.txt \
7676
--head ${{ env.BRANCH_NAME }} ${{ env.REVIEWER_ARG }} ${{ env.LABEL_ARG }}

.github/workflows/create-tag-on-merge.yml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ jobs:
7070
core.setOutput('pr-title', pr.title);
7171
core.setOutput('release-notes', releaseNote);
7272
core.setOutput('pr-number', pr.number);
73-
73+
74+
// Check if CHANGELOG is present using the same logic as above
75+
const hasChangelog = pr.body && pr.body.match(/__CHANGELOG__\s*(.*?)\s*_Generated by LinearB AI/s);
76+
core.setOutput('has-changelog', !!hasChangelog);
77+
7478
return pr.labels.some(label => label.name.includes('auto-deploy'));
7579
}
7680
return false;
@@ -80,14 +84,19 @@ jobs:
8084
env:
8185
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8286
run: |
83-
# Create release notes using printf to handle special characters safely
84-
printf "## What's Changed\n\n%s in [#%s](https://github.com/${{ github.repository }}/pull/%s)\n\n%s\n" \
85-
"${{ steps.should-deploy.outputs.pr-title }}" \
86-
"${{ steps.should-deploy.outputs.pr-number }}" \
87-
"${{ steps.should-deploy.outputs.pr-number }}" \
88-
"${{ steps.should-deploy.outputs.release-notes }}" > release_notes.md
87+
if [ "${{ steps.should-deploy.outputs.has-changelog }}" = "true" ]; then
88+
# Use custom release notes from CHANGELOG
89+
printf "## What's Changed\n\n%s in [#%s](https://github.com/${{ github.repository }}/pull/%s)\n\n%s\n" \
90+
"${{ steps.should-deploy.outputs.pr-title }}" \
91+
"${{ steps.should-deploy.outputs.pr-number }}" \
92+
"${{ steps.should-deploy.outputs.pr-number }}" \
93+
"${{ steps.should-deploy.outputs.release-notes }}" > release_notes.md
94+
gh release create $NEW_TAG --notes-file release_notes.md
95+
else
96+
# Use GitHub's automatic release notes generation
97+
gh release create $NEW_TAG --generate-notes
98+
fi
8999
90-
gh release create $NEW_TAG --notes-file release_notes.md
91100
git checkout $NEW_TAG
92101
npm run update-v2-tag
93102

0 commit comments

Comments
 (0)