Skip to content

Commit 5628d74

Browse files
authored
misc: Add check for PR names (#181)
1 parent cfe8b99 commit 5628d74

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Check PR format workflow
2+
3+
on:
4+
pull_request:
5+
types: [opened, reopened, edited]
6+
branches: [master]
7+
8+
jobs:
9+
gitlint:
10+
# Filter out Draft Pull Requests
11+
if: github.event.pull_request.draft == false
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v1
15+
- name: Set up Python 3.7
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: 3.7
19+
- name: Install dependencies
20+
run: python -m pip install gitlint==0.15.0
21+
- name: Run Gitlint
22+
run: python -c "import json; print(json.load(open('$GITHUB_EVENT_PATH'))['pull_request']['title'])" | gitlint

.gitlint

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[general]
2+
contrib=contrib-title-conventional-commits
3+
4+
# In the CI workflow, gitlint only checks the title of the commits, so errors
5+
# for missing the body of the commits are ignored.
6+
ignore=body-is-missing
7+
8+
[contrib-title-conventional-commits]
9+
types=feat,fix,misc

0 commit comments

Comments
 (0)