Skip to content

Commit 193cc1e

Browse files
committed
chore: add templates
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
1 parent e7664d1 commit 193cc1e

4 files changed

Lines changed: 68 additions & 27 deletions

File tree

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ insert_final_newline = true
88
trim_trailing_whitespace = true
99
end_of_line = lf
1010
max_line_length = 160
11+
12+
[*.{yaml,yml}]
13+
indent_size = 2

.github/labeler.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 1
2+
labels:
3+
- label: "chore"
4+
title: "^chore:.*"
5+
- label: "🐞 bug"
6+
title: "^fix:.*"
7+
- label: "✨ enhancement"
8+
title: "^feat:.*"
9+
- label: "📖 docs"
10+
title: "^docs:.*"

.github/workflows/pr-check.yaml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/pr.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Pull Request
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- reopened
7+
- synchronize
8+
- labeled
9+
- unlabeled
10+
11+
jobs:
12+
add-labels:
13+
runs-on: ubuntu-latest
14+
if: >-
15+
!contains(github.event.pull_request.labels.*.name, '💥 breaking-change') &&
16+
!contains(github.event.pull_request.labels.*.name, '✨ enhancement') &&
17+
!contains(github.event.pull_request.labels.*.name, '🐞 bug') &&
18+
!contains(github.event.pull_request.labels.*.name, '📖 docs') &&
19+
!contains(github.event.pull_request.labels.*.name, 'chore') &&
20+
!contains(github.event.pull_request.labels.*.name, '🛠️ dependencies')
21+
steps:
22+
- uses: srvaroa/labeler@master
23+
env:
24+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
25+
validate-labels:
26+
name: check labels missing
27+
runs-on: ubuntu-latest
28+
steps:
29+
- name: check
30+
if: >-
31+
!contains(github.event.pull_request.labels.*.name, '💥 breaking-change') &&
32+
!contains(github.event.pull_request.labels.*.name, '✨ enhancement') &&
33+
!contains(github.event.pull_request.labels.*.name, '🐞 bug') &&
34+
!contains(github.event.pull_request.labels.*.name, '📖 docs') &&
35+
!contains(github.event.pull_request.labels.*.name, 'chore') &&
36+
!contains(github.event.pull_request.labels.*.name, '🛠️ dependencies')
37+
run: >-
38+
echo One of the following labels is missing on this PR:
39+
breaking-change enhancement bug docs chore && exit 1
40+
validate-title:
41+
name: check title prefix
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
45+
- name: check
46+
run: |
47+
PR_TITLE_PREFIX=$(echo "$PR_TITLE" | cut -d':' -f1)
48+
if [[ "$PR_TITLE_PREFIX" == "fix"* ]] || [[ "$PR_TITLE_PREFIX" == "feat"* ]] || [[ "$PR_TITLE_PREFIX" == "chore"* ]]; then
49+
exit 0
50+
fi
51+
52+
echo "PR title must start with feat, fix or chore"
53+
exit 1
54+
env:
55+
PR_TITLE: ${{ github.event.pull_request.title }}

0 commit comments

Comments
 (0)