Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit a20bae2

Browse files
committed
ci: add PR title validator
1 parent 2280853 commit a20bae2

File tree

4 files changed

+98
-4
lines changed

4 files changed

+98
-4
lines changed

.github/autolabeler.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
template: "Mandatory field" #https://github.com/release-drafter/release-drafter/blob/master/bin/generate-schema.js#L15
2+
autolabeler:
3+
- label: 'breaking'
4+
body:
5+
- '/BREAKING CHANGE/i'
6+
- label: 'fix'
7+
title:
8+
- '/^fix:/'
9+
- label: 'feat'
10+
title:
11+
- '/^feat:/'
12+
- label: 'docs'
13+
title:
14+
- '/^docs:/'
15+
- label: 'chore'
16+
title:
17+
- '/^chore:/'
18+
- label: 'ci'
19+
title:
20+
- '/^ci:/'
21+
- label: 'perf'
22+
title:
23+
- '/^perf:/'
24+
- label: 'refactor'
25+
title:
26+
- '/^refactor:/'
27+
- label: 'style'
28+
title:
29+
- '/^style:/'
30+
- label: 'test'
31+
title:
32+
- '/^test:/'

.github/dependabot.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@
55

66
version: 2
77
updates:
8-
# Enable version updates for npm
98
- package-ecosystem: "npm"
109
# Look for `package.json` and `lock` files in the `root` directory
1110
directory: "/"
1211
# Check the npm registry for updates every day (weekdays)
1312
schedule:
1413
interval: "daily"
14+
commit-message:
15+
prefix: "chore:"
1516
- package-ecosystem: "github-actions"
1617
directory: "/"
1718
schedule:
1819
interval: "weekly"
19-
labels:
20-
- "actions-update"
21-
- "bot"
20+
commit-message:
21+
prefix: "ci:"

.github/pr-title-checker-config.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"LABEL": {
3+
"name": "title needs formatting",
4+
"color": "EEEEEE"
5+
},
6+
"CHECKS": {
7+
"prefixes": [
8+
"fix: ",
9+
"feat: ",
10+
"docs: ",
11+
"chore: ",
12+
"ci: ",
13+
"perf: ",
14+
"refactor: ",
15+
"style: ",
16+
"test: "
17+
],
18+
"ignoreLabels": [
19+
"skip-changelog",
20+
"skip-ci"
21+
]
22+
},
23+
"MESSAGES": {
24+
"success": "PR title is valid",
25+
"failure": "PR title is invalid",
26+
"notice": "Please read the doc: [Release versioning strategy](https://heartex.atlassian.net/l/c/brYSL9qf)"
27+
}
28+
}

.github/workflows/pr-labeler.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "PR labeler"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- reopened
9+
- synchronize
10+
- ready_for_review
11+
branches:
12+
- master
13+
- develop
14+
- 'lse-release/**'
15+
16+
jobs:
17+
autolabel:
18+
name: "PR label validator"
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: hmarr/[email protected]
22+
- uses: thehanimo/[email protected]
23+
name: "Validate PR's title"
24+
with:
25+
GITHUB_TOKEN: ${{ secrets.GIT_PAT }}
26+
pass_on_octokit_error: false
27+
configuration_path: ".github/pr-title-checker-config.json"
28+
- uses: release-drafter/[email protected]
29+
name: "Set PR's label based on title"
30+
with:
31+
disable-releaser: true
32+
config-name: autolabeler.yml
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GIT_PAT }}

0 commit comments

Comments
 (0)