Skip to content

Commit e24cfe4

Browse files
committed
ci: create PR for release changelog updates
1 parent 465b888 commit e24cfe4

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77

88
permissions:
99
contents: write
10+
pull-requests: write
1011

1112
jobs:
1213
release:
@@ -46,17 +47,15 @@ jobs:
4647
env:
4748
GITHUB_REPO: ${{ github.repository }}
4849

49-
- name: Commit and push CHANGELOG.md
50-
run: |
51-
# see https://github.com/orgs/community/discussions/26560
52-
git config user.name "github-actions[bot]"
53-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
54-
55-
if git diff --quiet -- CHANGELOG.md; then
56-
echo "No CHANGELOG.md updates to commit."
57-
exit 0
58-
fi
59-
60-
git add CHANGELOG.md
61-
git commit -m "chore(release): update CHANGELOG.md"
62-
git push origin ${{ github.event.repository.default_branch }}
50+
- name: Create changelog update pull request
51+
uses: peter-evans/create-pull-request@v7
52+
with:
53+
base: ${{ github.event.repository.default_branch }}
54+
branch: chore/release-changelog-${{ github.ref_name }}
55+
title: chore(release): update CHANGELOG.md for ${{ github.ref_name }}
56+
commit-message: chore(release): update CHANGELOG.md for ${{ github.ref_name }}
57+
body: |
58+
## Summary
59+
- regenerate `CHANGELOG.md` for `${{ github.ref_name }}`
60+
- avoid pushing directly to `${{ github.event.repository.default_branch }}`
61+
- keep the release workflow aligned with the repository's PR-first policy

0 commit comments

Comments
 (0)