9494 git commit -am "Update version to ${VERSION}"
9595 git push origin "v${VERSION}_release"
9696
97+ - name : Update CHANGELOG for release
98+ run : |
99+ # Replace "## Unreleased" with "## ${VERSION} - $(date +%Y-%m-%d)"
100+ sed -i "s/## Unreleased/## ${VERSION} - $(date +%Y-%m-%d)/" CHANGELOG.md
101+ git add CHANGELOG.md
102+ git commit -m "Update CHANGELOG for version ${VERSION}"
103+ git push origin "v${VERSION}_release"
104+
97105 - name : Create pull request against the release branch
98106 env :
99107 GITHUB_TOKEN : ${{ env.BOT_TOKEN_GITHUB_RW_PATOKEN }}
@@ -103,4 +111,24 @@ jobs:
103111
104112 By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice." \
105113 --head v${{ github.event.inputs.version }}_release \
106- --base release/v${MAJOR_MINOR}.x
114+ --base release/v${MAJOR_MINOR}.x
115+
116+ - name : Create pull request against main for CHANGELOG
117+ env :
118+ GITHUB_TOKEN : ${{ env.BOT_TOKEN_GITHUB_RW_PATOKEN }}
119+ run : |
120+ # Create branch for main PR
121+ git checkout -b "v${VERSION}_changelog_main"
122+
123+ # Update CHANGELOG for main (keep Unreleased + add release entry)
124+ sed -i "s/## Unreleased/## Unreleased\n\n## ${VERSION} - $(date +%Y-%m-%d)/" CHANGELOG.md
125+ git add CHANGELOG.md
126+ git commit -m "Add ${VERSION} to CHANGELOG"
127+ git push origin "v${VERSION}_changelog_main"
128+
129+ gh pr create --title "Add ${VERSION} to CHANGELOG" \
130+ --body "This PR adds the ${VERSION} release entry to CHANGELOG.md.
131+
132+ By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice." \
133+ --head v${{ github.event.inputs.version }}_changelog_main \
134+ --base main
0 commit comments