Skip to content

Commit 18838ea

Browse files
authored
Merge pull request #2454 from jasonbahl/feature/lint-pull-requests
ci: add linter to ensure PR titles adhere to conventional commit standards
2 parents 088850c + 60840a0 commit 18838ea

2 files changed

Lines changed: 44 additions & 1 deletion

File tree

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ Thanks for sending a pull request! Please make sure you click the link above to
55
66
🚨 Please review the [guidelines for contributing](/.github/CONTRIBUTING.md) to this repository.
77
8-
- [ ] Make sure you are making a pull request against the **develop branch** (left side). Also you should start *your branch* off *our develop*.
8+
- [ ] Make sure your PR title follows Conventional Commit standards. See: [https://www.conventionalcommits.org/en/v1.0.0/#specification](https://www.conventionalcommits.org/en/v1.0.0/#specification)
9+
- [ ] Make sure you are making a pull request against the **develop branch** (left side). Also you should start *your branch* off *our master*.
910
- [ ] Make sure you are requesting to pull request from a **topic/feature/bugfix branch** (right side). Don't pull request from your master!
1011
1112
-->

.github/workflows/lint-pr.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "Lint Pull Request"
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
name: Validate Pull Request Title
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: amannn/action-semantic-pull-request@v4
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
with:
19+
# see: https://github.com/commitizen/conventional-commit-types
20+
types: |
21+
feat
22+
fix
23+
docs
24+
style
25+
refactor
26+
perf
27+
test
28+
build
29+
ci
30+
chore
31+
revert
32+
requireScope: false
33+
ignoreLabels: |
34+
bot
35+
ignore-semantic-pull-request
36+
# For work-in-progress PRs you can typically use draft pull requests
37+
# from GitHub. However, private repositories on the free plan don't have
38+
# this option and therefore this action allows you to opt-in to using the
39+
# special "[WIP]" prefix to indicate this state. This will avoid the
40+
# validation of the PR title and the pull request checks remain pending.
41+
# Note that a second check will be reported if this is enabled.
42+
wip: true

0 commit comments

Comments
 (0)