diff --git a/.github/workflows/changelog-check.yml b/.github/workflows/changelog-check.yml new file mode 100644 index 0000000000..5142f3db42 --- /dev/null +++ b/.github/workflows/changelog-check.yml @@ -0,0 +1,20 @@ +name: Check Changelog + +on: + pull_request: + types: [opened, synchronize, labeled, unlabeled] + merge_group: + +jobs: + check-changelog: + name: Check changelog + runs-on: ubuntu-latest + steps: + - name: Check changelog + uses: MetaMask/github-tools/.github/actions/check-changelog@v1 + with: + base-branch: ${{ github.event.pull_request.base.ref }} + head-ref: ${{ github.head_ref }} + labels: ${{ toJSON(github.event.pull_request.labels) }} + pr-number: ${{ github.event.pull_request.number }} + repo: ${{ github.repository }} diff --git a/README.md b/README.md index 914f27cced..1e52e4c970 100644 --- a/README.md +++ b/README.md @@ -62,9 +62,40 @@ purposes only. See [`packages/create-package/README.md`](packages/create-package/README.md). +### Updating changelogs + +Each package in this repo has a file named `CHANGELOG.md` which is used to +record consumer-facing changes that have been published over time. All +changelogs follow the ["Keep a Changelog"](https://keepachangelog.com/) +specification (enforced by `@metamask/auto-changelog`). + +If a PR introduces a consumer-facing change to one or more packages, their changelogs must +be updated. This is enforced by CI. When updating changelogs, keep the following in mind: + +- A changelog is not a git history; it is a summary of consumer-facing changes introduced by + a particular release. + - Consider each PR from the perspective of a consumer of an individual package. Changelog + entries may differ between packages. + - For example, if you're introducing feature X to package A, and it contains an incidental + change Y to package B, the package changelogs should reflect this. +- Place new entries under the "Unreleased" section. +- Place changes into categories. Consult the ["Keep a Changelog"](https://keepachangelog.com/en/1.1.0/#how) specification for the list. +- Highlight breaking changes by prefixing them with `**BREAKING:**`. +- Omit non-consumer facing changes from the changelog. +- Do not simply reuse the commit message, but describe exact changes to the API or usable + surface area of the project. +- Use a list nested under a changelog entry to enumerate more details about a change if need be. +- Include links (e.g. `#123) to the pull request(s) that introduced each change. +- Combine like changes from multiple pull requests into a single changelog entry if necessary. +- Split disparate changes from the same pull request into multiple entries if necessary. +- Omit reverted changes from the changelog. + +If your PR does not contain any consumer-facing changes, add the label `no-changelog`, and the +changelog validation CI job will be skipped. + ### Releasing -For information on creating releases, see the [MetaMask/core release documentation](https://github.com/MetaMask/core/blob/main/docs/contributing.md#releasing-changes). +For information on creating releases, see the [MetaMask/core release documentation](https://github.com/MetaMask/core/blob/d6ce6e1c917b1a05356df365281a5db83f500210/docs/processes/releasing.md). ### Patches diff --git a/package.json b/package.json index d4deeb4edc..62b743b9d4 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "@lavamoat/allow-scripts": "^3.3.2", "@lavamoat/preinstall-always-fail": "^2.1.0", "@metamask/auto-changelog": "^5.3.0", - "@metamask/create-release-branch": "^4.1.3", + "@metamask/create-release-branch": "^4.1.4", "@metamask/eslint-config": "^15.0.0", "@metamask/eslint-config-nodejs": "^15.0.0", "@metamask/eslint-config-typescript": "^15.0.0", diff --git a/yarn.lock b/yarn.lock index 917daae3e1..36769eb041 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2147,9 +2147,9 @@ __metadata: languageName: node linkType: hard -"@metamask/create-release-branch@npm:^4.1.3": - version: 4.1.3 - resolution: "@metamask/create-release-branch@npm:4.1.3" +"@metamask/create-release-branch@npm:^4.1.4": + version: 4.1.4 + resolution: "@metamask/create-release-branch@npm:4.1.4" dependencies: "@metamask/action-utils": "npm:^1.0.0" "@metamask/auto-changelog": "npm:^4.0.0" @@ -2168,7 +2168,7 @@ __metadata: prettier: ">=3.0.0" bin: create-release-branch: bin/create-release-branch.js - checksum: 10/fbaece7e989b559e5b8d70197b3abc86550f6678db4f35e75c0931522c45b91dc0d7fd4bb1e6aca567137d4715c803594c356ad9169ba6a6a55edf109b2827cc + checksum: 10/91282f9f20f576332bd88771988e58739e1dc7088068c74d54c5a3910bdab2e74c1f75b2205bdfa59a114dd18329d1080e04aada344b671348017c021edc82bc languageName: node linkType: hard @@ -4094,7 +4094,7 @@ __metadata: "@lavamoat/allow-scripts": "npm:^3.3.2" "@lavamoat/preinstall-always-fail": "npm:^2.1.0" "@metamask/auto-changelog": "npm:^5.3.0" - "@metamask/create-release-branch": "npm:^4.1.3" + "@metamask/create-release-branch": "npm:^4.1.4" "@metamask/eslint-config": "npm:^15.0.0" "@metamask/eslint-config-nodejs": "npm:^15.0.0" "@metamask/eslint-config-typescript": "npm:^15.0.0"