-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (79 loc) · 2.81 KB
/
semantic-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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: "Semantic Pull Requests"
on:
pull_request:
types:
- opened
- edited
- synchronize
permissions:
pull-requests: write
jobs:
main:
runs-on: ubuntu-latest
# Job steps
steps:
- name: Lint Pull Requests name
uses: amannn/action-semantic-pull-request@v5
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
fix
feat
ci
chore
build
test
- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.lint_pr_title.outputs.error_message != null)
with:
header: pr-title-lint-error
message: |
Hey there! 👋🏼
We require pull request titles to follow [Truflation's Developer Guideline](https://github.com/truflation/developers) and it looks like your proposed title needs to be adjusted.
Details:
```
${{ steps.lint_pr_title.outputs.error_message }}
```
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.lint_pr_title.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Add new step here
- uses: georgeciubotaru/action-pr-title@master
id: pr_title_length
with:
min_length: 10
max_length: 65
- uses: marocchino/sticky-pull-request-comment@v2
# When the previous steps fails, the workflow would stop. By adding this
# condition you can continue the execution with the populated error message.
if: always() && (steps.pr_title_length.outputs.error_message != null)
with:
header: pr-title-length-error
message: |
```
Hey there! 👋🏼
We require pull request titles to follow the max length convention and it looks like your proposed title needs to be adjusted.
Details:
${{ steps.pr_title_length.outputs.error_message }}
```
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Delete a previous comment when the issue has been resolved
- if: ${{ steps.pr_title_length.outputs.error_message == null }}
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-length-error
delete: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}