Skip to content

Commit 0f4691d

Browse files
authored
ci: Replace regex commit checker with commitlint. (#234)
* ci: Replace regex commit checker with commitlint. * ci: Address Copilot review on commitlint workflow.
1 parent af2902c commit 0f4691d

1 file changed

Lines changed: 14 additions & 17 deletions

File tree

.github/workflows/check-commits.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,19 @@ jobs:
1414
check-commit-messages:
1515
runs-on: ubuntu-latest
1616
steps:
17-
- name: "📜 Check commit messages format"
18-
uses: gsactions/commit-message-checker@v1
17+
- name: "⏳ Checkout repository"
18+
uses: actions/checkout@v4
1919
with:
20-
pattern: '^[^!]+: [A-Za-z]+.+ .+\.$'
21-
flags: "gm"
22-
error: "Commit subject line must match the following pattern: <scope>: <description>."
23-
excludeTitle: "false"
24-
excludeDescription: "true"
25-
checkAllCommitMessages: "true"
26-
accessToken: ${{ secrets.GITHUB_TOKEN }}
27-
- name: "📜 Check commit messages length"
28-
uses: gsactions/commit-message-checker@v1
20+
fetch-depth: 0
21+
22+
- name: "🟢 Set up Node.js"
23+
uses: actions/setup-node@v4
2924
with:
30-
pattern: "^[^#].{10,78}$"
31-
error: "Commit subject line maximum line length of 78 characters is exceeded."
32-
excludeTitle: "false"
33-
excludeDescription: "true"
34-
checkAllCommitMessages: "true"
35-
accessToken: ${{ secrets.GITHUB_TOKEN }}
25+
node-version: "20.17.x"
26+
cache: "npm"
27+
28+
- name: "🛠 Install commitlint"
29+
run: npm ci --ignore-scripts
30+
31+
- name: "📜 Validate commit messages"
32+
run: npx --no-install commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

0 commit comments

Comments
 (0)