forked from magma/magma
-
Notifications
You must be signed in to change notification settings - Fork 1
130 lines (125 loc) · 4.17 KB
/
semantic-pr.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# Copyright 2022 The Magma Authors.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# owner: any
# purpose: PR format checker
# remediation: https://github.com/magma/magma/wiki/Contributing-Code#commit-and-pull-request-guidelines
name: PR Check Title Or Commit Message
on:
# Semantic PR module only works with pull_request_target
pull_request_target:
types:
- opened
- reopened
- edited
- synchronize
- ready_for_review
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
check-semantic-pr:
runs-on: ubuntu-20.04
steps:
- uses: amannn/action-semantic-pull-request@01d5fd8a8ebb9aafe902c40c53f0f4744f7381eb # [email protected]
id: semantic-pr
if: ${{ ! startsWith(github.event.pull_request.title, 'Revert ') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configure which types are allowed.
# Default: https://github.com/commitizen/conventional-commit-types
types: |
feat
fix
docs
style
refactor
perf
test
build
ci
chore
revert
# Configure which scopes are allowed.
scopes: |
aaa_server
agw
amf
ci
cloud
connectiond
control_proxy
csfb
ctraced
cwg
deps
deps-dev
directoryd
dp
eap
eap_aka
eap_sim
enodebd
envoy_controller
eventd
feg
feg_hello
feg_relay
health
lte
magmad
mme
mobilityd
monitord
nms
orc8r
pipelined
policydb
radiusd
redirectd
redis
s6a_proxy
s8_proxy
sctpd
session_proxy
sessiond
smf
smsd
state
subscriberdb
swx_proxy
td-agent-bit
upf
# Configure that a scope must always be provided.
requireScope: false
# For work-in-progress PRs you can typically use draft pull requests
# from GitHub. However, private repositories on the free plan don't have
# this option and therefore this action allows you to opt in to using the
# special "[WIP]" prefix to indicate this state. This will avoid the
# validation of the PR title and the pull request checks remain pending.
# Note that a second check will be reported if this is enabled.
wip: true
# When using "Squash and merge" on a PR with only one commit, GitHub
# will suggest using that commit message instead of the PR title for the
# merge commit, and it's easy to commit this by mistake. Enable this option
# to also validate the commit message for one commit PRs.
validateSingleCommit: true
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # [email protected]
if: always()
- uses: ./.github/workflows/composite/comment-on-pr
if: always()
env:
check-type: Semantic PR check
check-documentation: See [instructions on formatting your commit and pull request titles](https://github.com/magma/magma/wiki/Contributing-Code#pull-request-and-commit-message-title-are-following-conventional-commits-format).
with:
check-type: ${{ env.check-type }}
check-documentation: ${{ env.check-documentation }}
job-status: ${{ steps.semantic-pr.outcome }}