Skip to content

Commit 45abcdd

Browse files
committed
ci: open changelog PR instead of pushing to protected branch
The release-triggered Changelog workflow was pushing the CHANGELOG.md update directly to 4.x via stefanzweifel/git-auto-commit-action. Branch protection on 4.x ("Changes must be made through a pull request") rejects that push, so every release since v4.0.10 has shipped without its CHANGELOG entry. Swap the commit-and-push step for peter-evans/create-pull-request, which opens a PR from chore/changelog-<tag> with the skip-changelog label, then enable auto-merge (squash) so the PR lands without human intervention. 4.x has no required status checks and 0 required reviews, so auto-merge clears immediately. Also tag the PR with skip-changelog so it's excluded from the next release's auto-generated notes (per .github/release.yml).
1 parent c6faa7a commit 45abcdd

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

.github/workflows/changelog.yml

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
permissions:
88
contents: write
9+
pull-requests: write
910

1011
jobs:
1112
update:
@@ -34,9 +35,23 @@ jobs:
3435
latest-version: ${{ github.event.release.name }}
3536
release-notes: ${{ github.event.release.body }}
3637

37-
- name: Commit updated CHANGELOG
38-
uses: stefanzweifel/git-auto-commit-action@v7
38+
- name: Open changelog PR
39+
id: cpr
40+
uses: peter-evans/create-pull-request@v7
3941
with:
40-
branch: ${{ steps.branch.outputs.name }}
41-
commit_message: Update CHANGELOG
42-
file_pattern: CHANGELOG.md
42+
base: ${{ steps.branch.outputs.name }}
43+
branch: chore/changelog-${{ github.event.release.tag_name }}
44+
delete-branch: true
45+
commit-message: "chore: update CHANGELOG for ${{ github.event.release.tag_name }}"
46+
title: "chore: update CHANGELOG for ${{ github.event.release.tag_name }}"
47+
body: |
48+
Auto-generated CHANGELOG update for release ${{ github.event.release.tag_name }}.
49+
50+
Release notes: ${{ github.event.release.html_url }}
51+
labels: skip-changelog
52+
53+
- name: Enable auto-merge
54+
if: steps.cpr.outputs.pull-request-operation == 'created'
55+
env:
56+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
run: gh pr merge --auto --squash "${{ steps.cpr.outputs.pull-request-number }}"

0 commit comments

Comments
 (0)