Skip to content

Commit 0cd16cb

Browse files
authored
chore: Enforce per-PR changelog updates in CI (#920)
Introduces a new process for maintaining our `CHANGELOG.md` files by copying over [the latest `.github/workflows/changelog-check.yml` from `MetaMask/core`](https://github.com/MetaMask/core/blob/d6ce6e1c917b1a05356df365281a5db83f500210/.github/workflows/changelog-check.yml). See the root `README.md` on this branch for instructions. Also opportunistically bumps `@metamask/create-release-branch` to the latest version. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > <sup>[Cursor Bugbot](https://cursor.com/bugbot) is generating a summary for commit 98e2a41. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 4a05751 commit 0cd16cb

4 files changed

Lines changed: 58 additions & 7 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Check Changelog
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, labeled, unlabeled]
6+
merge_group:
7+
8+
jobs:
9+
check-changelog:
10+
name: Check changelog
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check changelog
14+
uses: MetaMask/github-tools/.github/actions/check-changelog@v1
15+
with:
16+
base-branch: ${{ github.event.pull_request.base.ref }}
17+
head-ref: ${{ github.head_ref }}
18+
labels: ${{ toJSON(github.event.pull_request.labels) }}
19+
pr-number: ${{ github.event.pull_request.number }}
20+
repo: ${{ github.repository }}

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,40 @@ purposes only.
6262

6363
See [`packages/create-package/README.md`](packages/create-package/README.md).
6464

65+
### Updating changelogs
66+
67+
Each package in this repo has a file named `CHANGELOG.md` which is used to
68+
record consumer-facing changes that have been published over time. All
69+
changelogs follow the ["Keep a Changelog"](https://keepachangelog.com/)
70+
specification (enforced by `@metamask/auto-changelog`).
71+
72+
If a PR introduces a consumer-facing change to one or more packages, their changelogs must
73+
be updated. This is enforced by CI. When updating changelogs, keep the following in mind:
74+
75+
- A changelog is not a git history; it is a summary of consumer-facing changes introduced by
76+
a particular release.
77+
- Consider each PR from the perspective of a consumer of an individual package. Changelog
78+
entries may differ between packages.
79+
- For example, if you're introducing feature X to package A, and it contains an incidental
80+
change Y to package B, the package changelogs should reflect this.
81+
- Place new entries under the "Unreleased" section.
82+
- Place changes into categories. Consult the ["Keep a Changelog"](https://keepachangelog.com/en/1.1.0/#how) specification for the list.
83+
- Highlight breaking changes by prefixing them with `**BREAKING:**`.
84+
- Omit non-consumer facing changes from the changelog.
85+
- Do not simply reuse the commit message, but describe exact changes to the API or usable
86+
surface area of the project.
87+
- Use a list nested under a changelog entry to enumerate more details about a change if need be.
88+
- Include links (e.g. `#123) to the pull request(s) that introduced each change.
89+
- Combine like changes from multiple pull requests into a single changelog entry if necessary.
90+
- Split disparate changes from the same pull request into multiple entries if necessary.
91+
- Omit reverted changes from the changelog.
92+
93+
If your PR does not contain any consumer-facing changes, add the label `no-changelog`, and the
94+
changelog validation CI job will be skipped.
95+
6596
### Releasing
6697

67-
For information on creating releases, see the [MetaMask/core release documentation](https://github.com/MetaMask/core/blob/main/docs/contributing.md#releasing-changes).
98+
For information on creating releases, see the [MetaMask/core release documentation](https://github.com/MetaMask/core/blob/d6ce6e1c917b1a05356df365281a5db83f500210/docs/processes/releasing.md).
6899

69100
### Patches
70101

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"@lavamoat/allow-scripts": "^3.3.2",
5858
"@lavamoat/preinstall-always-fail": "^2.1.0",
5959
"@metamask/auto-changelog": "^5.3.0",
60-
"@metamask/create-release-branch": "^4.1.3",
60+
"@metamask/create-release-branch": "^4.1.4",
6161
"@metamask/eslint-config": "^15.0.0",
6262
"@metamask/eslint-config-nodejs": "^15.0.0",
6363
"@metamask/eslint-config-typescript": "^15.0.0",

yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2147,9 +2147,9 @@ __metadata:
21472147
languageName: node
21482148
linkType: hard
21492149

2150-
"@metamask/create-release-branch@npm:^4.1.3":
2151-
version: 4.1.3
2152-
resolution: "@metamask/create-release-branch@npm:4.1.3"
2150+
"@metamask/create-release-branch@npm:^4.1.4":
2151+
version: 4.1.4
2152+
resolution: "@metamask/create-release-branch@npm:4.1.4"
21532153
dependencies:
21542154
"@metamask/action-utils": "npm:^1.0.0"
21552155
"@metamask/auto-changelog": "npm:^4.0.0"
@@ -2168,7 +2168,7 @@ __metadata:
21682168
prettier: ">=3.0.0"
21692169
bin:
21702170
create-release-branch: bin/create-release-branch.js
2171-
checksum: 10/fbaece7e989b559e5b8d70197b3abc86550f6678db4f35e75c0931522c45b91dc0d7fd4bb1e6aca567137d4715c803594c356ad9169ba6a6a55edf109b2827cc
2171+
checksum: 10/91282f9f20f576332bd88771988e58739e1dc7088068c74d54c5a3910bdab2e74c1f75b2205bdfa59a114dd18329d1080e04aada344b671348017c021edc82bc
21722172
languageName: node
21732173
linkType: hard
21742174

@@ -4094,7 +4094,7 @@ __metadata:
40944094
"@lavamoat/allow-scripts": "npm:^3.3.2"
40954095
"@lavamoat/preinstall-always-fail": "npm:^2.1.0"
40964096
"@metamask/auto-changelog": "npm:^5.3.0"
4097-
"@metamask/create-release-branch": "npm:^4.1.3"
4097+
"@metamask/create-release-branch": "npm:^4.1.4"
40984098
"@metamask/eslint-config": "npm:^15.0.0"
40994099
"@metamask/eslint-config-nodejs": "npm:^15.0.0"
41004100
"@metamask/eslint-config-typescript": "npm:^15.0.0"

0 commit comments

Comments
 (0)