From 2c0390ec4db9802cd4bb077e4b7250b4ddc50054 Mon Sep 17 00:00:00 2001 From: status102 Date: Sat, 2 Dec 2023 21:47:49 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"ci:=20PR=20Checker=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=90=88=E5=B9=B6=E6=A3=80=E6=9F=A5=EF=BC=8C=E5=90=88=E5=B9=B6?= =?UTF-8?q?=E5=90=8E=E4=B8=8D=E5=86=8D=E6=A3=80=E6=9F=A5commit=20message"?= =?UTF-8?q?=20(#7459)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reverts MaaAssistantArknights/MaaAssistantArknights#7457 --- .github/workflows/pr-checker.yml | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/.github/workflows/pr-checker.yml b/.github/workflows/pr-checker.yml index 8d408ba246..2fd266cdb7 100644 --- a/.github/workflows/pr-checker.yml +++ b/.github/workflows/pr-checker.yml @@ -9,27 +9,8 @@ jobs: runs-on: ubuntu-latest steps: - - name: 检查 PR 是否已合并 - id: pr_status - uses: actions/github-script@v7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - script: | - const { data: pr } = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: context.payload.pull_request.number - }); - - if (pr.merged) { - console.log("PR(${context.payload.inputs.pr_number}) 已合并"); - } else { - console.log("PR(${context.payload.inputs.pr_number}) 未合并"); - } - core.setOutput("pr_merged", pr.merged); - - - name: Check Commit Message - if: ${{ steps.pr_status.outputs.pr_merged == 'False' }} + - name: Check Commits + if: github.event_name == 'pull_request' uses: actions/github-script@v7 with: github-token: ${{ secrets.GITHUB_TOKEN }} @@ -46,6 +27,6 @@ jobs: console.log(`check ${commits.length} commit(s)`); if (invalidCommits.length > 0) { - const invalidCommitMessages = invalidCommits.map(commit => commit.commit.message); - core.setFailed(`Invalid commit message found: ${invalidCommitMessages.join(", ")}`); + const invalidCommitNames = invalidCommits.map(commit => commit.commit.message); + core.setFailed(`Invalid commit names found: ${invalidCommitNames.join(", ")}`); }