From 6d1e50cc01602d54eee017ac08b26db5dc9fdfe2 Mon Sep 17 00:00:00 2001 From: status102 Date: Mon, 4 Dec 2023 09:48:23 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20PR=20Checker=E5=A2=9E=E5=8A=A0=E5=AF=B9?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=88=B6=E9=A1=B9=E6=95=B0=E9=87=8F=E7=9A=84?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E4=BB=A5=E9=81=BF=E5=85=8D=E9=80=9A=E8=BF=87?= =?UTF-8?q?=E6=94=B9=E5=90=8D=E5=BA=94=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pr-checker.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-checker.yml b/.github/workflows/pr-checker.yml index a8a4ec2e1f..2896563a78 100644 --- a/.github/workflows/pr-checker.yml +++ b/.github/workflows/pr-checker.yml @@ -22,11 +22,11 @@ jobs: }); const regex = /^((build|chore|ci|docs?|feat|fix|perf|refactor|rft|style|test|i18n)[\:\.\(\,]|[Rr]evert|[Rr]elease)/; - const invalidCommits = commits.filter(commit => !regex.test(commit.commit.message)); + const invalidCommits = commits.filter(commit => !regex.test(commit.commit.message) || commit.parents.length > 1); console.log(`check ${commits.length} commit(s)`); if (invalidCommits.length > 0) { const invalidCommitNames = invalidCommits.map(commit => commit.commit.message); - core.setFailed(`Invalid commit names found: ${invalidCommitNames.join(", ")}`); + core.setFailed(`Invalid commit found: ${invalidCommitNames.join(", ")}`); }