From ca51418bf04f89e6d12eb4130cc3b9188e4fbbd4 Mon Sep 17 00:00:00 2001 From: felinae98 <731499577@qq.com> Date: Sat, 21 May 2022 21:24:08 +0800 Subject: [PATCH] add release drafter --- .github/workflows/release-drafter.yml | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/release-drafter.yml diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml new file mode 100644 index 0000000..ed5192e --- /dev/null +++ b/.github/workflows/release-drafter.yml @@ -0,0 +1,39 @@ +name: Release Drafter + +on: + pull_request_target: + branches: + - main + types: + - closed + +jobs: + update-release-drafter: + runs-on: ubuntu-latest + concurrency: + group: pull-request-changelog + cancel-in-progress: true + steps: + - uses: actions/checkout@v3 + + - uses: release-drafter/release-drafter@v5 + id: release-drafter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Update Changelog + uses: docker://ghcr.io/nonebot/auto-changelog:master + with: + latest_changes_position: '# Change Log\n\n' + latest_changes_title: '## 最近更新' + replace_regex: '(?<=## 最近更新\n)[\s\S]*?(?=\n## )' + changelog_body: ${{ steps.release-drafter.outputs.body }} + commit_and_push: false + + - name: Commit and Push + run: | + git config user.name github-actions[bot] + git config user.email github-actions[bot]@users.noreply.github.com + git add . + git diff-index --quiet HEAD || git commit -m ":memo: Update changelog" + git push