-
Notifications
You must be signed in to change notification settings - Fork 447
90 lines (84 loc) · 2.47 KB
/
pr-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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: PR-Check
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
branches:
- main
jobs:
conventional-pr-check:
runs-on: ubuntu-20.04
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
submodules: true
fetch-depth: 0
- uses: amannn/action-semantic-pull-request@v5
id: pr-convention
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Types allowed (newline-delimited).
# Default: https://github.com/commitizen/conventional-commit-types
types: |
build
ci
docs
feat
fix
perf
refactor
test
chore
# Scopes allowed (newline-delimited).
scopes: |
core
python
k8s
coordinator
one
interactive
insight
analytical
learning
flex
# A scope can be not provided.
requireScope: false
disallowScopes: |
release
[A-Z]+
# If the PR contains one of these newline-delimited labels, the
# validation is skipped.
ignoreLabels: |
bot
ignore-semantic-pull-request
feature-docs-check:
runs-on: ubuntu-20.04
needs: conventional-pr-check
steps:
- uses: dorny/paths-filter@v2
id: doc-changes
with:
filters: |
src:
- 'docs/**'
- uses: actions-ecosystem/action-regex-match@v2
id: pr-regex-match
with:
text: ${{ github.event.pull_request.title }}
regex: 'feat.*|refactor.*'
- if: ${{ steps.pr-regex-match.outputs.match != '' && steps.doc-changes.outputs.src == 'false' }}
run: |
# echo "title=${{ github.event.pull_request.title }}"
# echo "steps.pr-regex-match.outputs.match=${{ steps.pr-regex-match.outputs.match }}"
# echo "steps.doc-changes.outputs.src=${{ steps.doc-changes.outputs.src }}"
echo " ❌ Uh oh! ❌ \n
We suggest that a PR with type @feat should has corresponding documentations. \n
If you believe this PR could be merged without documentation, please add @yecol as an extra reviewer for confirmation."
exit 1