Skip to content

Commit 40a1fb8

Browse files
authored
fix(ci): use event payload instead of external action for PR title checks (#17234)
1 parent 408bdd4 commit 40a1fb8

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

.github/workflows/pr-check-conventions.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,17 @@ jobs:
1616
permissions:
1717
contents: read
1818
steps:
19-
- uses: Slashgear/action-check-pr-title@76166c63ec0b25cdbe693e5e972e83ca186313fb
20-
with:
21-
regexp: '^(feat|fix|chore|docs|style|refactor|perf|test|build|ci|revert)(\([a-z0-9._/-]+\))?!?: .+ \(#[0-9]+(, ?#[0-9]+)*\)$'
22-
flags: "gm"
23-
helpMessage: "Format: 'type(scope?): description (#issue)' for example 'docs: updating a doc page (#1234)'. see https://github.com/OpenCTI-Platform/opencti/blob/master/CONTRIBUTING.md#how-can-you-contribute"
19+
- name: Check PR title matches convention
20+
env:
21+
PR_TITLE: ${{ github.event.pull_request.title }}
22+
run: |
23+
PATTERN='^(feat|fix|chore|docs|style|refactor|perf|test|build|ci|revert)(\([a-z0-9._/-]+\))?!?: .+ \(#[0-9]+(, ?#[0-9]+)*\)$'
24+
if ! echo "$PR_TITLE" | grep -Pq "$PATTERN"; then
25+
echo "::error::PR title does not match convention: '$PR_TITLE'"
26+
echo "Format: 'type(scope?): description (#issue)' for example 'docs: updating a doc page (#1234)'. see https://github.com/OpenCTI-Platform/opencti/blob/master/CONTRIBUTING.md#how-can-you-contribute"
27+
exit 1
28+
fi
29+
echo "PR title is valid: '$PR_TITLE'"
2430
2531
check-signed-commits:
2632
name: Check signed commits in PR

0 commit comments

Comments
 (0)