-
Notifications
You must be signed in to change notification settings - Fork 95
95 lines (82 loc) · 2.71 KB
/
pr-title.yml
File metadata and controls
95 lines (82 loc) · 2.71 KB
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
91
92
93
94
95
# Copied from https://github.com/paradigmxyz/reth/blob/a5755f72eb54d2c88d6f0b5778413144451e1724/.github/workflows/pr-title.yml
name: Pull Request
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
- labeled
permissions:
pull-requests: read
contents: read
jobs:
conventional-title:
name: Validate PR title is Conventional Commit
runs-on:
- runs-on=${{ github.run_id }}/runner=8cpu-linux-x64
permissions:
pull-requests: write
steps:
- name: Check title
id: lint_pr_title
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
fix
feat
chore
test
perf
refactor
docs
ci
release
audit
continue-on-error: true
- name: Add PR Comment for Invalid Title
if: steps.lint_pr_title.outcome == 'failure'
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
message: |
Your PR title doesn't follow the Conventional Commit guidelines.
**Example of valid titles:**
- `feat: add new user login`
- `fix: correct button size`
- `docs: update README`
**Usage:**
- `feat`: Introduces a new feature
- `fix`: Patches a bug
- `chore`: General maintenance tasks or updates
- `test`: Adding new tests or modifying existing tests
- `perf`: Performance improvements
- `refactor`: Changes to improve code structure
- `docs`: Documentation updates
- `ci`: Changes to CI/CD configurations
**Breaking Changes**
Breaking changes are noted by using an exclamation mark. For example:
- `feat!: changed the API`
- `chore(node)!: Removed unused public function`
**Help**
For more information, follow the guidelines here: https://www.conventionalcommits.org/en/v1.0.0/
- name: Remove Comment for Valid Title
if: steps.lint_pr_title.outcome == 'success'
uses: marocchino/sticky-pull-request-comment@v2
with:
header: pr-title-lint-error
delete: true
- name: Fail workflow if title invalid
if: steps.lint_pr_title.outcome == 'failure'
run: exit 1
execute-benchmarks:
name: Execute benchmarks
uses: ./.github/workflows/benchmarks-execute.yml
secrets: inherit
extension-tests:
name: Extension tests
uses: ./.github/workflows/extension-tests.yml
secrets: inherit