Skip to content

Changelog Rewrite

Changelog Rewrite #414

name: Changelog Rewrite
# Re-renders release-please's changelog from each PR's inner commits, so multi-commit
# squash-merged PRs render every conventional entry. Runs after Release Please completes and
# rewrites the open release PR (CHANGELOG.md on its branch, and the PR body). The GitHub
# Release later takes its notes from that CHANGELOG.md.
on:
workflow_run:
workflows: [Release Please]
types: [completed]
permissions: {}
concurrency:
group: changelog-rewrite-${{ github.ref }}
cancel-in-progress: false
jobs:
rewrite:
if: github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/create-github-app-token@v3
id: app-token
with:
app-id: ${{ secrets.RELEASE_BOT_APP_ID }}
private-key: ${{ secrets.RELEASE_BOT_PRIVATE_KEY }}
- uses: actions/checkout@v7.0.1
with:
ref: main
sparse-checkout: .github/scripts
sparse-checkout-cone-mode: false
persist-credentials: false
- name: Apply rewritten changelog
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
GH_REPO: ${{ github.repository }}
# Pin to the SHA that triggered the Release Please run we're reacting to,
# so a concurrent push to main can't widen our PR range past what
# release-please saw when it set the manifest versions.
GH_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
run: python3 .github/scripts/apply_changelog.py