Skip to content

Commit dd512fc

Browse files
committed
chore: auto-releasing and convention-commit pr title validation
Signed-off-by: jmeridth <jmeridth@gmail.com>
1 parent 39dd862 commit dd512fc

File tree

3 files changed

+126
-0
lines changed

3 files changed

+126
-0
lines changed

.github/release-drafter.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
name-template: 'v$RESOLVED_VERSION'
3+
tag-template: 'v$RESOLVED_VERSION'
4+
template: |
5+
# Changelog
6+
$CHANGES
7+
8+
See details of [all code changes](https://github.com/github/cleanowners/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) since previous release
9+
10+
categories:
11+
- title: '🚀 Features'
12+
labels:
13+
- 'feature'
14+
- 'enhancement'
15+
- title: '🐛 Bug Fixes'
16+
labels:
17+
- 'fix'
18+
- 'bugfix'
19+
- 'bug'
20+
- title: '🧰 Maintenance'
21+
labels:
22+
- 'infrastructure'
23+
- 'automation'
24+
- 'documentation'
25+
- 'dependencies'
26+
- 'revert'
27+
- title: '🏎 Performance'
28+
label: 'performance'
29+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
30+
version-resolver:
31+
major:
32+
labels:
33+
- 'breaking'
34+
minor:
35+
labels:
36+
- 'enhancement'
37+
patch:
38+
labels:
39+
- 'bug'
40+
- 'maintenance'
41+
- 'documentation'
42+
default: patch
43+
autolabeler:
44+
- label: 'automation'
45+
title:
46+
- '/^(build|ci|perf|refactor|test).*/i'
47+
- label: 'enhancement'
48+
title:
49+
- '/^(chore|style).*/i'
50+
- label: 'documentation'
51+
title:
52+
- '/^docs.*/i'
53+
- label: 'feature'
54+
title:
55+
- '/^feat.*/i'
56+
- label: 'fix'
57+
title:
58+
- '/^fix.*/i'
59+
- label: 'revert'
60+
title:
61+
- '/^revert.*/i'

.github/workflows/pr-title.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
## Reference: https://github.com/amannn/action-semantic-pull-request
2+
name: "Lint PR"
3+
4+
on:
5+
pull_request_target:
6+
types:
7+
- opened
8+
- edited
9+
- synchronize
10+
11+
permissions:
12+
contents: read
13+
14+
jobs:
15+
main:
16+
permissions:
17+
pull-requests: read
18+
statuses: write
19+
name: Validate PR title
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: amannn/action-semantic-pull-request@v5
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
with:
26+
# Configure which types are allowed (newline-delimited).
27+
# From: https://github.com/commitizen/conventional-commit-types/blob/master/index.json
28+
# listing all below
29+
types: |
30+
build
31+
chore
32+
ci
33+
docs
34+
feat
35+
fix
36+
perf
37+
refactor
38+
revert
39+
style
40+
test
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: Release Drafter
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
main:
14+
permissions:
15+
pull-requests: read
16+
statuses: write
17+
name: Generate release notes
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: release-drafter/release-drafter@v5
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
with:
24+
config-name: .github/release-drafter.yml
25+
# publish: true

0 commit comments

Comments
 (0)