diff --git a/.github/workflows/bump-gitstream-core.yml b/.github/workflows/bump-gitstream-core.yml index ad581d9b..ed5fdc42 100644 --- a/.github/workflows/bump-gitstream-core.yml +++ b/.github/workflows/bump-gitstream-core.yml @@ -6,9 +6,9 @@ on: workflow_dispatch: inputs: version: - description: Version number (ex. "2.1.133") + description: Version number (ex. "2.1.207") required: true - default: 2.1.133 + default: 2.1.207 ticket: description: LINBEE-XXXXX ticket number default: LINBEE-8514 @@ -71,6 +71,6 @@ jobs: git push origin HEAD:${{ env.BRANCH_NAME }} gh pr create \ --base develop \ - --title "Bump `@linearb/gitstream-core` to `${{ env.VERSION }}`" \ + --title "Bump \`@linearb/gitstream-core\` to \`${{ env.VERSION }}\`" \ --body-file pr_description.txt \ --head ${{ env.BRANCH_NAME }} ${{ env.REVIEWER_ARG }} ${{ env.LABEL_ARG }} diff --git a/.github/workflows/create-tag-on-merge.yml b/.github/workflows/create-tag-on-merge.yml index 1435a346..cc7b79a8 100644 --- a/.github/workflows/create-tag-on-merge.yml +++ b/.github/workflows/create-tag-on-merge.yml @@ -70,7 +70,11 @@ jobs: core.setOutput('pr-title', pr.title); core.setOutput('release-notes', releaseNote); core.setOutput('pr-number', pr.number); - + + // Check if CHANGELOG is present using the same logic as above + const hasChangelog = pr.body && pr.body.match(/__CHANGELOG__\s*(.*?)\s*_Generated by LinearB AI/s); + core.setOutput('has-changelog', !!hasChangelog); + return pr.labels.some(label => label.name.includes('auto-deploy')); } return false; @@ -80,14 +84,19 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - # Create release notes using printf to handle special characters safely - printf "## What's Changed\n\n%s in [#%s](https://github.com/${{ github.repository }}/pull/%s)\n\n%s\n" \ - "${{ steps.should-deploy.outputs.pr-title }}" \ - "${{ steps.should-deploy.outputs.pr-number }}" \ - "${{ steps.should-deploy.outputs.pr-number }}" \ - "${{ steps.should-deploy.outputs.release-notes }}" > release_notes.md + if [ "${{ steps.should-deploy.outputs.has-changelog }}" = "true" ]; then + # Use custom release notes from CHANGELOG + printf "## What's Changed\n\n%s in [#%s](https://github.com/${{ github.repository }}/pull/%s)\n\n%s\n" \ + "${{ steps.should-deploy.outputs.pr-title }}" \ + "${{ steps.should-deploy.outputs.pr-number }}" \ + "${{ steps.should-deploy.outputs.pr-number }}" \ + "${{ steps.should-deploy.outputs.release-notes }}" > release_notes.md + gh release create $NEW_TAG --notes-file release_notes.md + else + # Use GitHub's automatic release notes generation + gh release create $NEW_TAG --generate-notes + fi - gh release create $NEW_TAG --notes-file release_notes.md git checkout $NEW_TAG npm run update-v2-tag