-
Notifications
You must be signed in to change notification settings - Fork 9
50 lines (41 loc) · 1.09 KB
/
pr-validation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: pr-validation
on:
pull_request:
branches: [main]
defaults:
run:
shell: bash
concurrency:
group: ${{ github.head_ref }}.${{ github.sha }}.pr-validation
cancel-in-progress: true
jobs:
premerge:
runs-on: ubuntu-latest
steps:
- name: Don't save Bash session history
run: unset HISTFILE
- name: Checkout sources
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Validate the commit messages
run: |
sudo pip3 install -U Commitizen
git checkout -b premerge
git fetch origin main:main
cz check --rev-range main..premerge
- name: Detect changes
uses: dorny/paths-filter@v2
id: changes
with:
filters: |
shelltools:
- '*.sh'
- 'utils/*.sh'
- name: Lint shell
if: steps.changes.outputs.shelltools == 'true'
run: |
sudo apt update
sudo apt install -y shellcheck
shellcheck ./*.sh ./utils/*.sh -x