File tree 2 files changed +40
-37
lines changed
2 files changed +40
-37
lines changed Original file line number Diff line number Diff line change 1
- name : PR's
2
- on :
3
- pull_request :
4
- types : [opened, synchronize, reopened]
1
+ name : CI
2
+ # on:
3
+ # pull_request:
4
+ # types: [opened, synchronize, reopened]
5
5
6
6
env :
7
7
PR_NUMBER : ${{ github.event.pull_request.number }}
13
13
pr-e2e-test :
14
14
uses : ./.github/workflows/e2e-test.yml
15
15
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
-
49
16
check-file-format :
50
17
name : Check files changes follow guidelines
51
18
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
+ - uses : actions/checkout@v4
30
+ - uses : ./.github/actions/setup
31
+
32
+ - name : Check PR Title
33
+ run : |
34
+ PR_TITLE='${{ github.event.pull_request.title }}'
35
+ echo "PR TITLE": '$PR_TITLE'
36
+ echo "$PR_TITLE" | npx commitlint
You can’t perform that action at this time.
0 commit comments