From 49cd49df70e6b9d359fe1d040970fdb90dfdcdf6 Mon Sep 17 00:00:00 2001 From: Abin Simon Date: Wed, 1 Nov 2023 09:29:44 +0530 Subject: [PATCH] Create a PR to update changelog once release is complete --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 979a500b2..4d8cd726d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -743,3 +743,35 @@ jobs: - name: Validate docs run: | curl https://corsobackup.io/docs/quickstart/ | grep https://github.com/alcionai/corso/releases/download/${{ env.CORSO_VERSION }}/corso_${{ env.CORSO_VERSION }}_Linux_x86_64.tar.gz + + Update-Changelog: + needs: [Validate-Website-Artifacts, SetEnv] + environment: Testing + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + env: + TAG: ${{ needs.SetEnv.outputs.version }} + steps: + - uses: actions/checkout@v4 + + # TODO: Use this in goreleaser to use the changelog as the release notes + - name: Get current changelog + run: | + set -e + sed -n '/^## \[Unreleased\]/,/^## /p' changelog-current + cat changelog-current + + - name: Prep for next release + run: | + set -e + sed -i "s|## \[Unreleased\]\(.*\)|## [Unreleased]\1\n\n## [$TAG]\1 - $(date '+%F')|" CHANGELOG.md + sed -i "s|\[Unreleased\]: https://github.com/alcionai/corso/compare/\(v[0-9]*.[0-9]*.[0-9]*\)...HEAD.*|[Unreleased]: https://github.com/alcionai/corso/compare/$TAG...HEAD\n[$TAG]: https://github.com/alcionai/corso/compare/\1...$TAG|" CHANGELOG.md + cat CHANGELOG.md + + - name: Create Pull Request for changelog + uses: peter-evans/create-pull-request@v5 + with: + commit-message: Update CHANGELOG for release ${{ env.TAG }} + title: Update CHANGELOG for release ${{ env.TAG }} + body: Update CHANGELOG file and prep it for next release. + team-reviewers: corso-maintainers \ No newline at end of file