Skip to content

Commit f29ed34

Browse files
create automatic PR with changelog update (#166)
1 parent b8fd925 commit f29ed34

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

.github/workflows/release.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
echo "ERROR: Not found 'tip' section in CHANGELOG. Please add relavant entries and recreate git tag"
4545
exit 1
4646
fi
47-
export NOTES="$(sed -n '/# tip/,/## /p' CHANGELOG.md | sed -e '$d' -e '1d')"
47+
export NOTES="$(sed -n '/## tip/,/## /p' CHANGELOG.md | sed -e '$d' -e '1d')"
4848
sed -i 's/## tip/&\n\n## ${{ env.PKG_TAG }}/' CHANGELOG.md
4949
cat <<EOT > NOTES.md
5050
## ${{ env.PKG_TAG }}
@@ -55,3 +55,16 @@ jobs:
5555
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5656
run: |
5757
gh release create ${{ env.PKG_TAG }} --notes-file=NOTES.md ./dist/*
58+
- name: Automatic update changelog
59+
if: ${{ hashFiles('NOTES.md') != '' }}
60+
run: |
61+
rm -rf NOTES.md
62+
export CL_BRANCH="changelog-update-$(date +%s)"
63+
git checkout -b "${CL_BRANCH}"
64+
git add CHANGELOG.md
65+
git commit -S -m "Automatic update CHANGELOG"
66+
git push origin ${CL_BRANCH}
67+
gh pr create -f
68+
env:
69+
GH_TOKEN: "${{ secrets.VM_BOT_GH_TOKEN }}"
70+
GITHUB_TOKEN: "${{ secrets.VM_BOT_GH_TOKEN }}"

0 commit comments

Comments
 (0)