|
| 1 | +name: changelog-collate |
| 2 | + |
| 3 | +# Release-prep step: fold all .nextchanges/ fragments into NEXT_CHANGELOG.md and |
| 4 | +# open a single PR. Run this (and merge the PR) before dispatching the `tagging` |
| 5 | +# workflow so the release picks up every entry. Between releases, fragments |
| 6 | +# accumulate under .nextchanges/ without ever touching NEXT_CHANGELOG.md, so |
| 7 | +# contributor PRs don't conflict. |
| 8 | +on: |
| 9 | + workflow_dispatch: |
| 10 | + |
| 11 | +# Ensure two dispatches don't race on the PR branch. |
| 12 | +concurrency: |
| 13 | + group: changelog-collate |
| 14 | + |
| 15 | +permissions: |
| 16 | + contents: write |
| 17 | + pull-requests: write |
| 18 | + |
| 19 | +jobs: |
| 20 | + collate: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - name: Checkout repository |
| 24 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
| 25 | + |
| 26 | + - name: Install uv |
| 27 | + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 |
| 28 | + with: |
| 29 | + version: "0.8.9" |
| 30 | + |
| 31 | + - name: Collate fragments into NEXT_CHANGELOG.md |
| 32 | + run: uv run --script tools/collate_changelog.py |
| 33 | + |
| 34 | + - name: Expand PR references to links |
| 35 | + run: uv run --script tools/update_github_links.py NEXT_CHANGELOG.md |
| 36 | + |
| 37 | + - name: Determine release version |
| 38 | + id: version |
| 39 | + run: echo "version=$(grep -m1 '## Release v' NEXT_CHANGELOG.md | sed 's/^## Release //')" >> "$GITHUB_OUTPUT" |
| 40 | + |
| 41 | + - name: Create pull request |
| 42 | + uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1 |
| 43 | + with: |
| 44 | + # A fixed branch means a re-run updates the existing open PR in place |
| 45 | + # rather than opening a new one. |
| 46 | + branch: auto/collate-changelog |
| 47 | + commit-message: "Collate changelog fragments for ${{ steps.version.outputs.version }}" |
| 48 | + title: "Collate changelog fragments for ${{ steps.version.outputs.version }}" |
| 49 | + body: |- |
| 50 | + Folds every `.nextchanges/` fragment into the matching section of `NEXT_CHANGELOG.md` and removes the fragment files. |
| 51 | +
|
| 52 | + Merge this before dispatching the `tagging` workflow so the release picks up every entry. No fragments means no diff and no PR. |
0 commit comments