-
Notifications
You must be signed in to change notification settings - Fork 1.6k
46 lines (45 loc) · 1.32 KB
/
precommits_check.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
name: Pre-commit checks
on:
pull_request:
branches:
- dev
- main
types:
- opened
- edited
- synchronize
workflow_dispatch:
branches:
- dev
- main
jobs:
pre-commit-checks:
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
cache: "pip"
- name: Check Pull Request Title
uses: Slashgear/action-check-pr-title@main
with:
regexp: '(break|build|ci|docs|feat|fix|perf|refactor|style|test|ops|hotfix|release|maint|init|enh|revert)\([a-z,A-Z,0-9,\-,\_,\/,:]+\)(:)\s{1}([\w\s]+)' # Regex the title should match.
- name: Getting changed files list
id: files
uses: jitterbit/get-changed-files@master
- name: Checking changed files
shell: bash
run: |
echo "Changed files"
echo ${{ steps.files.outputs.all }}
echo "Github Client version"
echo $(gh --version)
- name: Pre-Commit Checks
run: |
python -m pip install --upgrade pip
pip install pre-commit
echo "Running pre-commit scans:"
# adding log display in case of pre-commit errors
pre-commit run -v --files ${{ steps.files.outputs.all }}
shell: bash