Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,58 @@

on:
push:
tags:
- v*
pull_request_target:
branches:
- master
types:
- closed
tags:
- v*

jobs:
update-release-draft:
if: github.event_name == 'pull_request_target'
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
concurrency:
group: pull-request-changelog
cancel-in-progress: true
steps:
- name: Generate token
id: generate-token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_KEY }}

- uses: actions/checkout@v6
with:
token: ${{ steps.generate-token.outputs.token }}

- name: Setup Node Environment
uses: ./.github/actions/setup-node

- uses: release-drafter/release-drafter@v6.0.0
id: release-drafter
env:
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

- name: Update Changelog
uses: docker://ghcr.io/nonebot/auto-changelog:master
with:
changelog_file: website/src/changelog/changelog.md
latest_changes_position: '# 更新日志\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: |
yarn prettier
git config user.name noneflow[bot]
git config user.email 129742071+noneflow[bot]@users.noreply.github.com
git add .
git diff-index --quiet HEAD || git commit -m ":memo: Update changelog"
git push

release:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
Expand Down
Loading