Skip to content

Commit 3c5af8f

Browse files
authored
Merge pull request #171 from nordic-game-lab/remove-mergeable
Remove Mergeable
2 parents 8a08c16 + f7f6311 commit 3c5af8f

File tree

3 files changed

+53
-5
lines changed

3 files changed

+53
-5
lines changed

.github/labeler.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# labeler "full" schema
2-
2+
# vscode uses the wrong schema when checking this file
3+
# the schema can be found here: https://github.com/jimschubert/labeler-action
34
# enable labeler on issues, prs, or both.
45
enable:
56
issues: true
@@ -26,7 +27,7 @@ comments:
2627
# - 'include' patterns will associate a label if any of these patterns match
2728
# - 'exclude' patterns will ignore this label if any of these patterns match
2829
labels:
29-
'bug':
30+
'Type:bug':
3031
include:
3132
- '\bbug[s]?\b'
3233
exclude: []
@@ -35,13 +36,28 @@ labels:
3536
- '\bhelp( me)?\b'
3637
exclude:
3738
- '\b\[test(ing)?\]\b'
38-
'enhancement':
39+
'Type:enhancement':
3940
include:
4041
- '\bfeat\b'
4142
exclude: []
42-
'chore':
43+
'Type:chore':
44+
include:
45+
- '\bUpdate\b'
46+
- '\bchore\b'
47+
exclude: []
48+
'Type:updates':
4349
include:
4450
- '\bUpdate\b'
51+
- '\bchore\b'
52+
exclude: []
53+
'Type:builder':
54+
include:
55+
- '\bngl-build\b'
56+
exclude: []
57+
'Type:ci':
58+
include:
59+
- '\baction\b'
60+
- '\bci\b'
4561
exclude: []
4662
'automerge':
4763
include:

.github/workflows/label.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ on:
33
issues:
44
types: [opened, edited, milestoned]
55
pull_request_target:
6-
types: [opened, milestoned]
6+
types: [opened]
77

88
jobs:
99
labeler:

.github/workflows/pr_checker.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: PR Validation
2+
on:
3+
pull_request:
4+
types: [opened, edited, synchronize, labeled, unlabeled, milestoned, demilestoned]
5+
6+
jobs:
7+
validate:
8+
name: Validate PR
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Validate Label
12+
uses: actions/github-script@v6
13+
with:
14+
script: |
15+
const labels = context.payload.pull_request.labels.map(label => label.name);
16+
const requiredRegex = new RegExp('^Type:');
17+
const hasRequiredLabel = labels.some(label => requiredRegex.test(label));
18+
if (!hasRequiredLabel) {
19+
core.setFailed("This PR must have a label starting with 'Type:'.");
20+
}
21+
- name: Validate Description
22+
uses: actions/github-script@v6
23+
with:
24+
script: |
25+
const body = context.payload.pull_request.body;
26+
if (!body) {
27+
core.setFailed(`
28+
The pr is required to have a description.
29+
Provide detail with **what** was changed,
30+
**why** it was changed, and **how** it was changed.
31+
`);
32+
}

0 commit comments

Comments
 (0)