File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Continous integration
2
+
3
+ on : [push, pull_request]
4
+
5
+ jobs :
6
+ build_and_lint :
7
+ timeout-minutes : 30
8
+ runs-on : ubuntu-latest
9
+ steps :
10
+ - uses : actions/checkout@v3
11
+ with :
12
+ fetch-depth : 0
13
+ - uses : actions/setup-node@v3
14
+ with :
15
+ node-version : 18
16
+ - name : Install commitlint
17
+ run : |
18
+ npm i -g @commitlint/config-conventional @commitlint/cli
19
+
20
+ - name : Install dependancies and build
21
+ run : |
22
+ if [ -f package.json ]; then
23
+ npm ci
24
+ npm run build
25
+ else
26
+ echo "package.json not found, skipping build step"
27
+ fi
28
+ shell : bash
29
+
30
+ - name : Validate commit messages
31
+ if : github.event_name == 'push'
32
+ run : |
33
+ commitlint -x @commitlint/config-conventional --from HEAD~1 --to HEAD --verbose
34
+
35
+ - name : Validate PR commits with commitlint
36
+ if : github.event_name == 'pull_request'
37
+ run : commitlint -x @commitlint/config-conventional --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
You can’t perform that action at this time.
0 commit comments