From c48345368c332b9cd6845a7093a3e529a613b77d Mon Sep 17 00:00:00 2001 From: KhazixW2 <3196497671@qq.com> Date: Sun, 8 Nov 2026 18:09:07 +0800 Subject: [PATCH 1/6] =?UTF-8?q?ci(release):=20=E7=94=A8=20git-cliff=20?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=94=9F=E6=88=90=20GitHub=20Release=20?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI 发版时 GitHub Release 正文只有一段静态的安装说明,看不出这个版本 到底改了什么。接入 git-cliff,让每次发版自动按 conventional commits 汇总本次变更。 - .github/cliff.toml:参考 MAAGC 的配置改写,按 commit 前缀分组 (新功能 / Bug修复 / 文档 / 性能优化 / 重构 / 日常维护 / CI 等), 正文带上 scope 与 GitHub 用户名,首次贡献者单列一节,尾部附安装与 使用命令 - publish.yml:新增 changelog job,checkout 完整历史与 tag,用 --current 生成「属于当前 tag 的提交」这一段;正式版额外用 --tag-pattern 把基线锁定在上一个正式版,这样 beta 期间的提交也会 并入本次说明;预发布版不加该参数 - 生成失败时退回静态安装说明(continue-on-error + fallback),不阻塞发版 - 顺带修掉旧写法里 YAML 双引号标量把换行折叠掉、导致 Release 正文 的代码块挤成一行的问题 验证: - actionlint 1.7.12 无告警 - git-cliff 2.14.2 在真实仓库(含 detached HEAD 于 tag 的检出)跑通, v1.3.0 输出与预期一致 - 预发布路径(不加 --tag-pattern)同样验证通过 --- .github/cliff.toml | 116 ++++++++++++++++++++++++++++++++++ .github/workflows/publish.yml | 73 +++++++++++++++++---- 2 files changed, 177 insertions(+), 12 deletions(-) create mode 100644 .github/cliff.toml diff --git a/.github/cliff.toml b/.github/cliff.toml new file mode 100644 index 0000000..bc74513 --- /dev/null +++ b/.github/cliff.toml @@ -0,0 +1,116 @@ +[remote.github] +owner = "MAA-AI" +repo = "MaaMCP" + +[changelog] +# 标题 +header = """ +# 更新日志 +""" + +body = """ +{%- macro remote_url() -%} + https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }} +{%- endmacro -%} + +{% macro print_commit(commit) -%} + - {% if commit.scope %}*({{ commit.scope }})* {% endif %}\ + {% if commit.breaking %}[**breaking**] {% endif %}\ + {{ commit.message | split(pat="\n") | first | upper_first }} \ + {% if commit.remote.username %} @{{ commit.remote.username }}{% else %} {{ commit.author.name }}{% endif %}\ + {%- if commit.footers -%} + {%- for footer in commit.footers -%} + {%- if footer.token == "Co-authored-by" -%} + {%- set co_author_name = footer.value | split(pat=" <") | first | trim %} @{{ co_author_name }} + {%- endif -%} + {%- endfor -%} + {%- endif -%} +{% endmacro -%} + +{% if version %} + ## {{ version | trim_start_matches(pat="v") }} ({{ timestamp | date(format="%Y-%m-%d") }}) +{% else %} + ## 未发布 +{% endif %} + +{% for group, commits in commits | group_by(attribute="group") %} + ### {{ group | striptags | trim | upper_first }} + {% for commit in commits + | filter(attribute="scope") + | sort(attribute="scope") %} + {{ self::print_commit(commit=commit) }} + {%- endfor %} + {% for commit in commits %} + {%- if not commit.scope -%} + {{ self::print_commit(commit=commit) }} + {% endif -%} + {% endfor -%} +{% endfor -%} +{%- if github -%} +{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} + ## 新贡献者 ❤️ +{% endif %} +{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} + * @{{ contributor.username }} made their first contribution + {%- if contributor.pr_number %} in \ + [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ + {%- endif %} +{%- endfor -%} +{%- endif %} +""" + +# 尾部 +footer = """ +{%- set latest_version = "" -%} +{%- for release in releases -%} + {%- if release.version and latest_version == "" -%} + {%- set_global latest_version = release.version -%} + {%- endif -%} +{%- endfor %} +{% if latest_version %} +# 安装 + +```sh +pip install maa-mcp=={{ latest_version }} +``` + +# 使用 + +```sh +maa-mcp +``` +{%- endif %} +""" + +[git] +# 过滤提交 +conventional_commits = true # 使用约定式提交格式 +filter_unconventional = false # 不过滤非约定式提交 +# 启用完整的 commit 信息 +split_commits = false +# 保留完整的 commit body +protect_breaking_commits = false +commit_parsers = [ + # 跳过包含 [skip changelog] 的 commit + { message = ".*\\[skip changelog\\].*", skip = true }, + { body = ".*\\[skip changelog\\].*", skip = true }, + { message = "^feat", group = "✨ 新功能" }, + { message = "^fix", group = "🐛 Bug修复" }, + { message = "^docs", group = "📚 文档" }, + { message = "^perf", group = "🚀 性能优化" }, + { message = "^refactor", group = "🚜 代码重构" }, + { message = "^style", group = "🎨 样式" }, + { message = "^test", group = "🧪 测试" }, + { message = "^chore", group = "🔧 日常维护" }, + { message = "^ci", group = "⚙️ 持续集成" }, + { message = "^remove", group = "🗑️ 移除" }, + { body = ".*security", group = "🔒 安全" }, + { message = "^[Rr]evert", group = "◀️ 撤销" }, +] + +# 排序规则 +sort_commits = "oldest" + +# 启用GitHub集成 +[git.github] +commits = true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ceadc67..3e322df 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,8 +11,68 @@ on: required: false jobs: + changelog: + name: Generate changelog + runs-on: ubuntu-latest + outputs: + release_body: ${{ steps.git-cliff.outputs.content || steps.fallback.outputs.body }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 # git-cliff 需要完整历史与 tag 才能算出版本区间 + ref: ${{ inputs.tag || github.ref }} # 检出版本对应的 tag,--current 才有归属 + + - name: Determine release tag + id: meta + run: | + tag="${{ inputs.tag || github.ref_name }}" + echo "tag=$tag" >> "$GITHUB_OUTPUT" + if [[ "$tag" =~ ^v[0-9]+[.][0-9]+[.][0-9]+$ ]]; then + echo "is_prerelease=false" >> "$GITHUB_OUTPUT" + else + echo "is_prerelease=true" >> "$GITHUB_OUTPUT" + fi + + - name: Generate a changelog + uses: orhun/git-cliff-action@v4 + id: git-cliff + continue-on-error: true # 生成失败时退回静态说明,不阻塞发版 + with: + config: .github/cliff.toml + # --current 只处理「属于当前 tag 的提交」,即本次要发布的这一版; + # --strip header 去掉「更新日志」大标题 + # 正式版加 tag-pattern 把基线锁定在「上一个正式版」,这样 beta 期间的 + # 提交也会并入本次发布说明;预发布版则用上一个任意 tag 作为基线 + args: >- + -vv --current --strip header + ${{ steps.meta.outputs.is_prerelease == 'false' && '--tag-pattern "^v[0-9]+[.][0-9]+[.][0-9]+$"' || '' }} + env: + OUTPUT: CHANGES.md + GITHUB_REPO: ${{ github.repository }} + + - name: Fallback release body + id: fallback + run: | + { + echo 'body<> "$GITHUB_OUTPUT" + build: name: Build distribution + needs: changelog runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -41,18 +101,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} tag_name: ${{ inputs.tag || github.ref_name }} - body: "# Installation - - ```sh - pip install maa-mcp==${{ inputs.tag || github.ref_name }} - ``` - - # Usage - - ```sh - maa-mcp - ``` - " + body: ${{ needs.changelog.outputs.release_body }} publish-to-pypi: name: Publish to PyPI From 3ac0e509755c98cac6b556d73fe09555e7d470aa Mon Sep 17 00:00:00 2001 From: KhazixW2 <3196497671@qq.com> Date: Sun, 8 Nov 2026 18:12:12 +0800 Subject: [PATCH 2/6] =?UTF-8?q?ci(release):=20=E7=BB=99=20changelog=20job?= =?UTF-8?q?=20=E6=98=BE=E5=BC=8F=E5=A3=B0=E6=98=8E=E5=8F=AA=E8=AF=BB?= =?UTF-8?q?=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-cliff 会调用 GitHub API 拉取 PR 元数据做贡献者统计,默认 token 权限 不足时该请求返回 403,git-cliff 直接 panic 而非优雅降级。 显式声明 contents: read(checkout)+ pull-requests: read(PR 元数据), 让权限需求可见且最小化。 --- .github/workflows/publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3e322df..826c383 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -14,6 +14,9 @@ jobs: changelog: name: Generate changelog runs-on: ubuntu-latest + permissions: + contents: read # checkout 仓库 + pull-requests: read # git-cliff 拉取 PR 元数据(贡献者统计) outputs: release_body: ${{ steps.git-cliff.outputs.content || steps.fallback.outputs.body }} steps: From e9ac53060779883969b81dff036ff1a84d279d0e Mon Sep 17 00:00:00 2001 From: KhazixW2 <3196497671@qq.com> Date: Sun, 8 Nov 2026 18:15:28 +0800 Subject: [PATCH 3/6] =?UTF-8?q?fix(packaging):=20=E6=8A=8A=20[project.urls?= =?UTF-8?q?]=20=E6=8C=87=E5=90=91=E5=AE=9E=E9=99=85=E4=BB=93=E5=BA=93=20MA?= =?UTF-8?q?A-AI/MaaMCP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 仓库已从 MistEO/MaaMCP 迁移到 MAA-AI/MaaMCP,旧地址靠 GitHub 重定向仍能 打开,但 PyPI 项目页展示的 Homepage / Repository 仍是旧名字。 --- pyproject.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7ed4c45..f006afd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -49,10 +49,10 @@ dependencies = [ ] [project.urls] -Homepage = "https://github.com/MistEO/MaaMCP" -Documentation = "https://github.com/MistEO/MaaMCP#readme" -Repository = "https://github.com/MistEO/MaaMCP" -Issues = "https://github.com/MistEO/MaaMCP/issues" +Homepage = "https://github.com/MAA-AI/MaaMCP" +Documentation = "https://github.com/MAA-AI/MaaMCP#readme" +Repository = "https://github.com/MAA-AI/MaaMCP" +Issues = "https://github.com/MAA-AI/MaaMCP/issues" [project.scripts] maa-mcp = "maa_mcp.__main__:main" From a2e6dcd21c6a709cf5dca449e2926a3d2e99a756 Mon Sep 17 00:00:00 2001 From: KhazixW2 <3196497671@qq.com> Date: Sun, 8 Nov 2026 18:19:21 +0800 Subject: [PATCH 4/6] =?UTF-8?q?ci:=20=E4=B8=B4=E6=97=B6=20changelog=20?= =?UTF-8?q?=E8=87=AA=E6=A3=80=E5=B7=A5=E4=BD=9C=E6=B5=81=EF=BC=88=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E5=90=8E=E5=88=A0=E9=99=A4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 按 publish.yml 的真实参数验证 changelog job:检出目标 tag、用同样的 --current/--tag-pattern 组合,确认能生成含版本号的正文而不是退回静态说明。 正文改用 env 传递,避免多行内容插值进 shell 脚本。 --- .github/workflows/_changelog_selftest.yml | 90 +++++++++++++++++++++++ .github/workflows/publish.yml | 1 - 2 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/_changelog_selftest.yml diff --git a/.github/workflows/_changelog_selftest.yml b/.github/workflows/_changelog_selftest.yml new file mode 100644 index 0000000..585f912 --- /dev/null +++ b/.github/workflows/_changelog_selftest.yml @@ -0,0 +1,90 @@ +name: Changelog self-test (temporary) + +# 临时自检(验证完即删):按 publish.yml 的真实参数验证 changelog job +on: + pull_request: + paths: + - ".github/workflows/_changelog_selftest.yml" + +jobs: + selftest: + name: Self-test changelog generation + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + outputs: + release_body: ${{ steps.git-cliff.outputs.content || steps.fallback.outputs.body }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + # 与 publish.yml 一致:检出目标 tag(detached HEAD 落在 tag 上) + ref: v1.3.0 + + - name: Show checkout state + run: | + echo "HEAD sha: $(git rev-parse HEAD)" + echo "HEAD tag: $(git describe --tags --exact-match HEAD)" + echo "all tags: $(git tag --list 'v*' | tr '\n' ' ')" + + - name: Determine release tag + id: meta + run: | + tag="v1.3.0" + echo "tag=$tag" >> "$GITHUB_OUTPUT" + if [[ "$tag" =~ ^v[0-9]+[.][0-9]+[.][0-9]+$ ]]; then + echo "is_prerelease=false" >> "$GITHUB_OUTPUT" + else + echo "is_prerelease=true" >> "$GITHUB_OUTPUT" + fi + + - name: Generate a changelog + uses: orhun/git-cliff-action@v4 + id: git-cliff + continue-on-error: true + with: + config: .github/cliff.toml + args: >- + -vv --current --strip header + ${{ steps.meta.outputs.is_prerelease == 'false' && '--tag-pattern "^v[0-9]+[.][0-9]+[.][0-9]+$"' || '' }} + env: + OUTPUT: CHANGES.md + GITHUB_REPO: ${{ github.repository }} + + - name: Fallback release body + id: fallback + run: | + { + echo 'body<> "$GITHUB_OUTPUT" + + - name: Report + env: + RELEASE_BODY: ${{ steps.git-cliff.outputs.content || steps.fallback.outputs.body }} + run: | + echo "### git-cliff exit_code: ${{ steps.git-cliff.outputs.exit_code }}" + echo "### version output: ${{ steps.git-cliff.outputs.version }}" + echo "----- BEGIN release_body -----" + printf '%s\n' "$RELEASE_BODY" + echo "----- END release_body -----" + + - name: Fail if fallback was used + if: contains(steps.git-cliff.outputs.content || steps.fallback.outputs.body, 'FALLBACK-USED') + run: | + echo "::error::changelog generation fell back to the static body" + exit 1 + + - name: Assert the changelog mentions the released version + if: ${{ !contains(steps.git-cliff.outputs.content || steps.fallback.outputs.body, 'FALLBACK-USED') }} + env: + RELEASE_BODY: ${{ steps.git-cliff.outputs.content || steps.fallback.outputs.body }} + run: | + if [[ "$RELEASE_BODY" != *"## 1.3.0"* ]]; then + echo "::error::changelog body does not contain '## 1.3.0'" + exit 1 + fi + echo "OK: changelog body contains '## 1.3.0'" diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 826c383..2b86e10 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,7 +30,6 @@ jobs: id: meta run: | tag="${{ inputs.tag || github.ref_name }}" - echo "tag=$tag" >> "$GITHUB_OUTPUT" if [[ "$tag" =~ ^v[0-9]+[.][0-9]+[.][0-9]+$ ]]; then echo "is_prerelease=false" >> "$GITHUB_OUTPUT" else From f61f940cf32b788c53d923087f25737755935ea4 Mon Sep 17 00:00:00 2001 From: KhazixW2 <3196497671@qq.com> Date: Sun, 8 Nov 2026 18:25:42 +0800 Subject: [PATCH 5/6] =?UTF-8?q?ci:=20=E8=87=AA=E6=A3=80=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E6=B5=81=E5=A2=9E=E5=8A=A0=20cliff.toml=20=E5=88=86=E7=BB=84?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E6=96=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/_changelog_selftest.yml | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/.github/workflows/_changelog_selftest.yml b/.github/workflows/_changelog_selftest.yml index 585f912..30073fe 100644 --- a/.github/workflows/_changelog_selftest.yml +++ b/.github/workflows/_changelog_selftest.yml @@ -21,18 +21,21 @@ jobs: with: fetch-depth: 0 # 与 publish.yml 一致:检出目标 tag(detached HEAD 落在 tag 上) - ref: v1.3.0 + # 用本 PR 的分支头模拟一个「已包含 cliff.toml 的正式版 tag」 + ref: ${{ github.event.pull_request.head.sha }} - - name: Show checkout state + - name: Simulate release checkout run: | + git tag -f v9.9.9 "${{ github.event.pull_request.head.sha }}" + git checkout --quiet v9.9.9 echo "HEAD sha: $(git rev-parse HEAD)" echo "HEAD tag: $(git describe --tags --exact-match HEAD)" - echo "all tags: $(git tag --list 'v*' | tr '\n' ' ')" + echo "cliff.toml present: $(test -f .github/cliff.toml && echo yes || echo no)" - name: Determine release tag id: meta run: | - tag="v1.3.0" + tag="v9.9.9" echo "tag=$tag" >> "$GITHUB_OUTPUT" if [[ "$tag" =~ ^v[0-9]+[.][0-9]+[.][0-9]+$ ]]; then echo "is_prerelease=false" >> "$GITHUB_OUTPUT" @@ -83,8 +86,14 @@ jobs: env: RELEASE_BODY: ${{ steps.git-cliff.outputs.content || steps.fallback.outputs.body }} run: | - if [[ "$RELEASE_BODY" != *"## 1.3.0"* ]]; then - echo "::error::changelog body does not contain '## 1.3.0'" + if [[ "$RELEASE_BODY" != *"## 9.9.9"* ]]; then + echo "::error::changelog body does not contain '## 9.9.9'" exit 1 fi - echo "OK: changelog body contains '## 1.3.0'" + # 用 cliff.toml 的自定义分组标题,确认走的是我们的配置而不是 + # git-cliff 的内置默认配置(默认是「## [x.y.z] - date」+ 英文分组) + if [[ "$RELEASE_BODY" != *"✨ 新功能"* && "$RELEASE_BODY" != *"🐛 Bug修复"* ]]; then + echo "::error::changelog body is not using cliff.toml's custom groups" + exit 1 + fi + echo "OK: changelog body contains '## 9.9.9' and uses cliff.toml groups" From 9284a111415ef4e30da198b0c9ae03db98aebacb Mon Sep 17 00:00:00 2001 From: KhazixW2 <3196497671@qq.com> Date: Sun, 8 Nov 2026 18:27:12 +0800 Subject: [PATCH 6/6] =?UTF-8?q?ci:=20=E7=A7=BB=E9=99=A4=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=20changelog=20=E8=87=AA=E6=A3=80=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/_changelog_selftest.yml | 99 ----------------------- 1 file changed, 99 deletions(-) delete mode 100644 .github/workflows/_changelog_selftest.yml diff --git a/.github/workflows/_changelog_selftest.yml b/.github/workflows/_changelog_selftest.yml deleted file mode 100644 index 30073fe..0000000 --- a/.github/workflows/_changelog_selftest.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: Changelog self-test (temporary) - -# 临时自检(验证完即删):按 publish.yml 的真实参数验证 changelog job -on: - pull_request: - paths: - - ".github/workflows/_changelog_selftest.yml" - -jobs: - selftest: - name: Self-test changelog generation - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: read - outputs: - release_body: ${{ steps.git-cliff.outputs.content || steps.fallback.outputs.body }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - # 与 publish.yml 一致:检出目标 tag(detached HEAD 落在 tag 上) - # 用本 PR 的分支头模拟一个「已包含 cliff.toml 的正式版 tag」 - ref: ${{ github.event.pull_request.head.sha }} - - - name: Simulate release checkout - run: | - git tag -f v9.9.9 "${{ github.event.pull_request.head.sha }}" - git checkout --quiet v9.9.9 - echo "HEAD sha: $(git rev-parse HEAD)" - echo "HEAD tag: $(git describe --tags --exact-match HEAD)" - echo "cliff.toml present: $(test -f .github/cliff.toml && echo yes || echo no)" - - - name: Determine release tag - id: meta - run: | - tag="v9.9.9" - echo "tag=$tag" >> "$GITHUB_OUTPUT" - if [[ "$tag" =~ ^v[0-9]+[.][0-9]+[.][0-9]+$ ]]; then - echo "is_prerelease=false" >> "$GITHUB_OUTPUT" - else - echo "is_prerelease=true" >> "$GITHUB_OUTPUT" - fi - - - name: Generate a changelog - uses: orhun/git-cliff-action@v4 - id: git-cliff - continue-on-error: true - with: - config: .github/cliff.toml - args: >- - -vv --current --strip header - ${{ steps.meta.outputs.is_prerelease == 'false' && '--tag-pattern "^v[0-9]+[.][0-9]+[.][0-9]+$"' || '' }} - env: - OUTPUT: CHANGES.md - GITHUB_REPO: ${{ github.repository }} - - - name: Fallback release body - id: fallback - run: | - { - echo 'body<> "$GITHUB_OUTPUT" - - - name: Report - env: - RELEASE_BODY: ${{ steps.git-cliff.outputs.content || steps.fallback.outputs.body }} - run: | - echo "### git-cliff exit_code: ${{ steps.git-cliff.outputs.exit_code }}" - echo "### version output: ${{ steps.git-cliff.outputs.version }}" - echo "----- BEGIN release_body -----" - printf '%s\n' "$RELEASE_BODY" - echo "----- END release_body -----" - - - name: Fail if fallback was used - if: contains(steps.git-cliff.outputs.content || steps.fallback.outputs.body, 'FALLBACK-USED') - run: | - echo "::error::changelog generation fell back to the static body" - exit 1 - - - name: Assert the changelog mentions the released version - if: ${{ !contains(steps.git-cliff.outputs.content || steps.fallback.outputs.body, 'FALLBACK-USED') }} - env: - RELEASE_BODY: ${{ steps.git-cliff.outputs.content || steps.fallback.outputs.body }} - run: | - if [[ "$RELEASE_BODY" != *"## 9.9.9"* ]]; then - echo "::error::changelog body does not contain '## 9.9.9'" - exit 1 - fi - # 用 cliff.toml 的自定义分组标题,确认走的是我们的配置而不是 - # git-cliff 的内置默认配置(默认是「## [x.y.z] - date」+ 英文分组) - if [[ "$RELEASE_BODY" != *"✨ 新功能"* && "$RELEASE_BODY" != *"🐛 Bug修复"* ]]; then - echo "::error::changelog body is not using cliff.toml's custom groups" - exit 1 - fi - echo "OK: changelog body contains '## 9.9.9' and uses cliff.toml groups"