From b795f804a75c0aa9e49b66b2bafe6e6c9baa4b3f Mon Sep 17 00:00:00 2001 From: LIghtJUNction Date: Mon, 16 Mar 2026 02:51:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20pr-checklist-check.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-checklist-check.yml | 42 ++---------------------- 1 file changed, 2 insertions(+), 40 deletions(-) diff --git a/.github/workflows/pr-checklist-check.yml b/.github/workflows/pr-checklist-check.yml index 26b145a05..f93eac126 100644 --- a/.github/workflows/pr-checklist-check.yml +++ b/.github/workflows/pr-checklist-check.yml @@ -23,7 +23,7 @@ jobs: const bad = regex.test(body); core.setOutput("bad", bad); - - name: Close PR if checklist violated + - name: Close PR if: steps.check.outputs.bad == 'true' uses: actions/github-script@v7 with: @@ -42,42 +42,4 @@ jobs: repo: context.repo.repo, pull_number: pr.number, state: "closed" - }); - - - name: Check target branch - uses: actions/github-script@v7 - with: - script: | - const pr = context.payload.pull_request; - const base = pr.base.ref; - - if (base !== "dev") { - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: pr.number, - body: `⚠️ 当前 PR 的 **目标分支是 \`${base}\`**。 - -建议将 PR 合并到 **\`dev\` 分支(开发分支)**,这样通常可以 **更快被合并**。 - -除非你的 PR **非常紧急**,否则请不要直接提交到 **\`master\` 分支**。` - }); - } - - - name: Check source branch - uses: actions/github-script@v7 - with: - script: | - const pr = context.payload.pull_request; - const head = pr.head.ref; - - if (head !== "dev") { - await github.rest.issues.createComment({ - owner: context.repo.owner, - repo: context.repo.repo, - issue_number: pr.number, - body: `💡 当前 PR 的 **源分支是 \`${head}\`**。 - -建议 **基于 \`dev\` 分支进行开发**,并及时从 \`dev\` 拉取更新,这样可以显著减少 **合并冲突的可能性**。` - }); - } \ No newline at end of file + }); \ No newline at end of file