From dbad55152c2ebc32c4e0ac3ae0ce0a64cf69164b Mon Sep 17 00:00:00 2001 From: Luca Comellini Date: Thu, 30 May 2024 19:41:00 -0700 Subject: [PATCH] Add PRs with release-notes labels to the CHANGELOG Problem: Looking for all the PRs that have the release-notes label is a manual process Solution: As a first step in automating this process, we add the list of PRs to the top of the CHANGELOG so they can be moved in the appropriate sections --- .github/release-notes.yml | 8 ++++++++ .github/workflows/release-pr.yml | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 .github/release-notes.yml diff --git a/.github/release-notes.yml b/.github/release-notes.yml new file mode 100644 index 0000000000..3e1b4ceb1e --- /dev/null +++ b/.github/release-notes.yml @@ -0,0 +1,8 @@ +changelog: + exclude: + labels: + - skip-changelog + categories: + - title: Changelog + labels: + - release-notes diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 2d9c5d7667..1b2822b20c 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -18,6 +18,8 @@ permissions: jobs: release: runs-on: ubuntu-22.04 + permissions: + contents: write steps: - name: Branch id: branch @@ -31,6 +33,13 @@ jobs: with: ref: ${{ steps.branch.outputs.branch }} + - name: Get Release Notes + id: notes + uses: lucacome/draft-release@8a63d32c79a171ae6048e614a8988f0ac3ed56d4 # v1.1.0 + with: + config-path: .github/release-notes.yml + dry-run: true + - name: Vars id: vars run: | @@ -76,6 +85,7 @@ jobs: sed -i -e "s/VERSION = edge/VERSION = ${{ inputs.version }}/g" Makefile sed -i "6r .github/CHANGELOG_TEMPLATE.md" CHANGELOG.md sed -i -e "s/%%VERSION%%/${{ inputs.version }}/g" CHANGELOG.md + sed -i "8a ${{ join(fromJson(steps.notes.outputs.release-sections).release-notes, '\n') }}\n" CHANGELOG.md make generate-manifests - name: Create Pull Request