File tree Expand file tree Collapse file tree 2 files changed +35
-35
lines changed Expand file tree Collapse file tree 2 files changed +35
-35
lines changed Original file line number Diff line number Diff line change 1- name : PR's
1+ name : CI
22on :
33 pull_request :
4- types : [opened, synchronize, reopened]
4+ # types: [opened, synchronize, reopened]
55
66env :
77 PR_NUMBER : ${{ github.event.pull_request.number }}
1313 pr-e2e-test :
1414 uses : ./.github/workflows/e2e-test.yml
1515
16- check-commit-lint :
17- name : Check commit message follows guidelines
18- runs-on : ubuntu-latest
19- steps :
20- - uses : actions/checkout@v4
21- - uses : ./.github/actions/setup
22-
23- - name : Execute commitlint
24- run : npx commitlint --from=origin/${{ github.base_ref }}
25-
26- - name : Get PR Title
27- run : " echo 'PR Title: ${{ github.event.pull_request.title }}'"
28-
29- - name : Get commit messages
30- run : |
31- BODY=$(git log \
32- --abbrev-commit ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} \
33- --pretty=format:'* %s%n%n%b')
34- TITLE='${{ github.event.pull_request.title }}'
35-
36- echo $TITLE
37- echo '---------'
38- echo $BODY
39- echo '---------'
40- echo "${TITLE}\n${BODY}"
41- echo '---------'
42-
43- echo "${TITLE}\n${BODY}" > commit-message.txt
44- cat commit-message.txt
45-
46- - name : Check commit message
47- run : cat commit-message.txt | npx commitlint
48-
4916 check-file-format :
5017 name : Check files changes follow guidelines
5118 runs-on : ubuntu-latest
Original file line number Diff line number Diff line change 1+ name : Enforce Semantic Commits
2+
3+ on :
4+ pull_request :
5+ types : [opened, edited, synchronize] # ? reopened
6+
7+ jobs :
8+ check-semantic-commits :
9+ name : Check Semantic Commits
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - uses : actions/checkout@v4
14+ - uses : ./.github/actions/setup
15+
16+ - name : Fetch all commits for the PR
17+ run : git fetch origin +refs/pull/${{ github.event.pull_request.number }}/merge
18+
19+ - name : Check commit messages
20+ run : |
21+ COMMIT_MESSAGES="$(git log --pretty=format:'%s' --abbrev-commit ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }})"
22+ echo "$COMMIT_MESSAGES" | npx commitlint
23+
24+ # 'Check if the PR title is a valid semantic commit message'
25+ check-pr-title :
26+ name : Check PR Title
27+ runs-on : ubuntu-latest
28+ steps :
29+ - name : Check PR Title
30+ run : |
31+ PR_TITLE='${{ github.event.pull_request.title }}'
32+ echo "PR TITLE": '$PR_TITLE'
33+ echo "$PR_TITLE" | npx commitlint
You can’t perform that action at this time.
0 commit comments