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
23 changes: 23 additions & 0 deletions .github/workflows/changelog-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Changelog nav check

on:
pull_request:
paths:
- 'changelog/**'
- 'docs.json'
- 'merge-queue/changelog.mdx'
- 'flaky-tests/changelog.mdx'
- 'scripts/sync-changelog.py'

jobs:
check-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Check changelog nav is in sync
run: python3 scripts/sync-changelog.py --check
37 changes: 37 additions & 0 deletions .github/workflows/changelog-sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Changelog nav sync

on:
push:
branches: [main]
paths:
- 'changelog/**'

permissions:
contents: write

jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: '3.12'

- name: Run changelog sync
run: python3 scripts/sync-changelog.py

- name: Check for changes
id: diff
run: |
git diff --quiet && echo "changed=false" >> "$GITHUB_OUTPUT" || echo "changed=true" >> "$GITHUB_OUTPUT"

- name: Commit and push
if: steps.diff.outputs.changed == 'true'
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add docs.json changelog/index.mdx merge-queue/changelog.mdx flaky-tests/changelog.mdx
git commit -m "chore(changelog): sync nav from changelog entries"
git push
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
*.py
*.py
!scripts/*.py
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,23 @@ Sticky labels that mark how a PR was sourced or where it needs extra eyes. Addit

GitHub's default labels (`bug`, `documentation`, `enhancement`, etc.) are also present but not used in our automated workflows.

## Changelog automation

Changelog entries live in `changelog/*.mdx`. Each entry's frontmatter (`title`, `description`, `date`, `category`, `type`) is the single source of truth — the nav sidebar, master index, and product-page indexes are all generated from it.

### Adding a changelog entry

1. Create `changelog/YYYY-MM-DD-<slug>.mdx` with the required frontmatter.
2. Run `python3 scripts/sync-changelog.py` to regenerate the four nav files.
3. Commit both the new entry and the updated nav files.

### CI enforcement

Two GitHub Actions workflows keep things in sync:

- **`changelog-check.yml`** runs on PRs that touch changelog-related files. It calls `sync-changelog.py --check`, which exits non-zero if the nav files don't match what the entries would generate. If this check fails, run the sync script locally and push the result.
- **`changelog-sync.yml`** runs on pushes to `main`. If a changelog entry landed without the nav files being regenerated, the action auto-commits the fix. This is a safety net — the PR check should catch drift before merge.

## Need help?

### Troubleshooting
Expand Down
Loading
Loading