-
Notifications
You must be signed in to change notification settings - Fork 399
54 lines (51 loc) · 1.63 KB
/
validate-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
name: Validate Pull Request
permissions:
pull-requests: write
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
jobs:
validate-pr:
runs-on: ubuntu-latest
steps:
- name: Pull Request Title is Conventional
id: lint_pr_title
uses: amannn/action-semantic-pull-request@e32d7e603df1aa1ba07e981f2a23455dee596825
with:
# Recommended Prefixes from https://github.com/conventional-changelog/commitlint/blob/master/%40commitlint/config-conventional/README.md#type-enum
types: |
build
chore
ci
docs
feat
fix
perf
refactor
revert
security
style
test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- if: failure()
name: Add PR comment if failed
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31
with:
header: pr-title-lint-error
message: |
Thank you for your contribution! We require all PR titles to follow the [Conventional Commits specification](https://www.conventionalcommits.org/en/v1.0.0/).
Please update your PR title with the appropriate type and we'll try again!
```
${{ steps.lint_pr_title.outputs.error_message}}
```
- if: success()
name: Remove PR comment if valid
uses: marocchino/sticky-pull-request-comment@331f8f5b4215f0445d3c07b4967662a32a2d3e31
with:
header: pr-title-lint-error
delete: true