Skip to content

Commit

Permalink
create automatic PR with changelog update (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewChubatiuk authored Dec 17, 2024
1 parent b8fd925 commit f29ed34
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <<EOT > NOTES.md
## ${{ env.PKG_TAG }}
Expand All @@ -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 }}"

0 comments on commit f29ed34

Please sign in to comment.