From f29ed346c48d1b9dc0bca20396250047d65e5a43 Mon Sep 17 00:00:00 2001 From: Andrii Chubatiuk Date: Tue, 17 Dec 2024 18:08:15 +0200 Subject: [PATCH] create automatic PR with changelog update (#166) --- .github/workflows/release.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index dbdef00..b08c6cd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -44,7 +44,7 @@ jobs: echo "ERROR: Not found 'tip' section in CHANGELOG. Please add relavant entries and recreate git tag" exit 1 fi - export NOTES="$(sed -n '/# tip/,/## /p' CHANGELOG.md | sed -e '$d' -e '1d')" + export NOTES="$(sed -n '/## tip/,/## /p' CHANGELOG.md | sed -e '$d' -e '1d')" sed -i 's/## tip/&\n\n## ${{ env.PKG_TAG }}/' CHANGELOG.md cat < NOTES.md ## ${{ env.PKG_TAG }} @@ -55,3 +55,16 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh release create ${{ env.PKG_TAG }} --notes-file=NOTES.md ./dist/* + - name: Automatic update changelog + if: ${{ hashFiles('NOTES.md') != '' }} + run: | + rm -rf NOTES.md + export CL_BRANCH="changelog-update-$(date +%s)" + git checkout -b "${CL_BRANCH}" + git add CHANGELOG.md + git commit -S -m "Automatic update CHANGELOG" + git push origin ${CL_BRANCH} + gh pr create -f + env: + GH_TOKEN: "${{ secrets.VM_BOT_GH_TOKEN }}" + GITHUB_TOKEN: "${{ secrets.VM_BOT_GH_TOKEN }}"