Skip to content

Commit e46cd78

Browse files
committed
ci: add commitizen workflow
1 parent 959d5fd commit e46cd78

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/commitizen.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: commitizen
2+
3+
on:
4+
merge_group:
5+
pull_request:
6+
7+
jobs:
8+
check_pr_title:
9+
name: check_pr_title
10+
if: github.event_name == 'pull_request'
11+
uses: dfinity/ci-tools/.github/workflows/check-pr-title.yaml@main
12+
13+
check_commit_messages:
14+
name: check_commit_messages
15+
if: github.event_name == 'merge_group'
16+
uses: dfinity/ci-tools/.github/workflows/check-commit-messages.yaml@main
17+
18+
commitizen:
19+
name: commitizen:required
20+
runs-on: ubuntu-latest
21+
needs: [check_pr_title, check_commit_messages]
22+
if: always()
23+
steps:
24+
- name: Check previous jobs
25+
run: |
26+
if [[ "${{ needs.check_pr_title.result }}" == "success" || "${{ needs.check_pr_title.result }}" == "skipped" ]] &&
27+
[[ "${{ needs.check_commit_messages.result }}" == "success" || "${{ needs.check_commit_messages.result }}" == "skipped" ]]; then
28+
echo "All required jobs passed or were skipped."
29+
else
30+
echo "One or more jobs failed."
31+
exit 1
32+
fi

0 commit comments

Comments
 (0)