Skip to content

Commit 6dca084

Browse files
committed
fix
1 parent 86c4ac4 commit 6dca084

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

.github/workflows/pr.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,24 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Check PR Title Prefix
12+
id: title-check
1213
uses: actions/github-script@v7
1314
with:
1415
script: |
15-
const titlePrefixes = ['feat', 'fix', 'break', 'chore'];
16+
const titlePrefixes = ["feat", "fix", "break", "chore"];
1617
const title = context.payload.pull_request.title.toLowerCase();
17-
const titleHasValidPrefix = titlePrefixes.some(prefix => title.startsWith(`${prefix}:`));
18+
const titleHasValidPrefix = titlePrefixes.some((prefix) => title.startsWith(`${prefix}:`));
1819
if (!titleHasValidPrefix) { process.exit(-1); }
1920
20-
- if: failure()
21-
uses: thollander/actions-comment-pull-request@v2
21+
- uses: thollander/actions-comment-pull-request@v2
22+
if: success()
23+
with:
24+
message: |
25+
"✅ PR title meet the requirements"
26+
comment_tag: PR title check result
27+
28+
- uses: thollander/actions-comment-pull-request@v2
29+
if: failure()
2230
with:
2331
message: |
2432
"🚨 PR title does not meet the requirements. It must start with one of the following prefixes: 'feat:', 'fix:', 'chore:', 'break:'."

0 commit comments

Comments
 (0)