Skip to content

Commit b829d0f

Browse files
Triggers, messaging, release notes in changelog CI
1. Changes when the CI is run. This avoids "bad runs" if a release fails, as it depends on a successful workflow run. 2. Copies the generated release note to the changelog This intends to reduce merge conflicts due to individually updated changelogs. 3. Big red message in PR to merge This adds a note to the PR message to not squash to help users perform the correct action.
1 parent b2bfb22 commit b829d0f

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/changelog-release-update.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
name: "Update Changelog"
33

44
on:
5-
release:
6-
types: [released]
7-
workflow_dispatch: ~
5+
workflow_run:
6+
workflows:
7+
- Upload Python Package
8+
types:
9+
- completed
810

911
permissions:
1012
pull-requests: write
@@ -13,6 +15,7 @@ permissions:
1315
jobs:
1416
update:
1517
runs-on: ubuntu-latest
18+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1619

1720
steps:
1821
- name: Checkout code
@@ -25,11 +28,18 @@ jobs:
2528
with:
2629
latest-version: ${{ github.event.release.tag_name }}
2730
heading-text: ${{ github.event.release.name }}
31+
release-notes: ${{ github.event.release.body }}
2832

2933
- name: Create Pull Request
3034
uses: peter-evans/create-pull-request@v6
3135
with:
3236
branch: docs/changelog-update-${{ github.event.release.tag_name }}
37+
base: develop
3338
title: '[Changelog] Update to ${{ github.event.release.tag_name }}'
39+
body: |
40+
This PR updates the changelog to include the changes in the latest release.
41+
42+
> [!CAUTION]
43+
> Merge DO NOT squash to correctly update the tag version of `develop` branch.
3444
add-paths: |
3545
CHANGELOG.md

0 commit comments

Comments
 (0)