Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Changelog

on:
pull_request:
branches: [master]
types: [opened, synchronize, reopened, labeled, unlabeled]

jobs:
has_changelog:
runs-on: ubuntu-latest
# Opt-out: PRs labeled 'No changelog' skip the check entirely
# (docs-only, dependency bumps, CI tweaks).
if: ${{ !contains(github.event.pull_request.labels.*.name, 'No changelog') }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check that the PR adds a changelog entry
run: |
git fetch origin "${{ github.base_ref }}"
head_sha="${{ github.event.pull_request.head.sha || 'HEAD' }}"
changed="$(git diff --name-only "origin/${{ github.base_ref }}"..."$head_sha" -- changelog/)"
if [ -z "$changed" ]; then
echo "::error::No changelog entry found. Add a file under changelog/ (see changelog/README.md), or add the 'No changelog' label if this PR is docs/CI/deps-only."
exit 1
fi
echo "Changelog entry present:"
echo "$changed"
Empty file added changelog/.gitkeep
Empty file.
22 changes: 22 additions & 0 deletions changelog/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Changelog entries

Every PR targeting `master` must add at least one file under this directory,
describing the user-facing change. A GitHub Actions workflow
(`.github/workflows/changelog.yml`) enforces this on every pull request.

## Convention

- One file per change. Name it after the Phabricator ticket (`T50530`) or, if
there is no ticket, a short descriptive slug (`access-log`).
- File content is one or more bullet lines describing the change, e.g.:
```
- [T50530] Bump sentry version
```
- Entries are collated into the top-level `CHANGELOG.md` at release time.

## Skipping the check

For docs-only, dependency-bump, or CI-only PRs that need no changelog entry,
add the `no-changelog` label to the PR. The workflow will skip the check.

See `.github/workflows/changelog.yml` for the exact enforcement logic.
Loading