-
Notifications
You must be signed in to change notification settings - Fork 287
83 lines (68 loc) · 2.84 KB
/
pr-title.yml
File metadata and controls
83 lines (68 loc) · 2.84 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
name: PR Title
on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
permissions:
pull-requests: write
jobs:
lint:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6
id: lint_pr_title
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
docs
style
refactor
perf
test
chore
ci
build
scopes: |
[a-z][a-z0-9_-]*
requireScope: false
subjectPattern: ^(?![A-Z]).+$
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
should not start with an uppercase character.
- uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
if: always() && (steps.lint_pr_title.outputs.error_message != null)
continue-on-error: true
with:
header: pr-title-lint-error
message: |
Pull request titles must follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format, because this repository uses squash merges and the PR title becomes the commit message.
**Format:** `<type>(<scope>): <subject>`
**Valid types:** `feat`, `fix`, `docs`, `style`, `refactor`, `perf`, `test`, `chore`, `ci`, `build`
**Scope** is optional but recommended — use the affected resource name, e.g. `feat(grafana_dashboard): add uid attribute`.
**Subject** should be lowercase and use imperative mood (e.g. "add" not "added").
**Breaking changes:** append `!` after the type/scope, e.g. `feat(grafana_folder)!: rename uid to folder_uid`. Explain the breaking change in the PR description.
**Examples:**
- `feat(grafana_dashboard): add uid attribute`
- `fix(grafana_folder): handle missing parent on import`
- `feat(grafana_folder)!: rename uid to folder_uid`
- `chore: update Go dependencies`
- `docs: regenerate resource documentation`
See [CONTRIBUTING.md](https://github.com/grafana/terraform-provider-grafana/blob/main/CONTRIBUTING.md#pr-title-format) for full details.
<details><summary>Error details</summary>
```
${{ steps.lint_pr_title.outputs.error_message }}
```
</details>
- uses: marocchino/sticky-pull-request-comment@773744901bac0e8cbb5a0dc842800d45e9b2b405 # v2.9.4
if: ${{ steps.lint_pr_title.outputs.error_message == null }}
continue-on-error: true
with:
header: pr-title-lint-error
delete: true