Skip to content

Commit d351d23

Browse files
authored
ci: add labeler (#146)
1 parent 7301fad commit d351d23

File tree

6 files changed

+305
-0
lines changed

6 files changed

+305
-0
lines changed

.github/issue-labeler.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
packages:asset-manager:
2+
- "### Which (package|utils|package or utils) is this (bug
3+
report|feature request) for\\?\\n\\nasset-manager\\n"
4+
5+
packages:common:
6+
- "### Which (package|utils|package or utils) is this (bug
7+
report|feature request) for\\?\\n\\ncommon\\n"
8+
9+
packages:config:
10+
- "### Which (package|utils|package or utils) is this (bug
11+
report|feature request) for\\?\\n\\nconfig\\n"
12+
13+
packages:core:
14+
- "### Which (package|utils|package or utils) is this (bug
15+
report|feature request) for\\?\\n\\ncore\\n"
16+
17+
packages:ecs-client:
18+
- "### Which (package|utils|package or utils) is this (bug
19+
report|feature request) for\\?\\n\\necs-client\\n"
20+
21+
packages:ecs-lib:
22+
- "### Which (package|utils|package or utils) is this (bug
23+
report|feature request) for\\?\\n\\necs-lib\\n"
24+
25+
packages:ecs-server:
26+
- "### Which (package|utils|package or utils) is this (bug
27+
report|feature request) for\\?\\n\\necs-server\\n"
28+
29+
packages:graphics-2d:
30+
- "### Which (package|utils|package or utils) is this (bug
31+
report|feature request) for\\?\\n\\ngraphics-2d\\n"
32+
33+
packages:input:
34+
- "### Which (package|utils|package or utils) is this (bug
35+
report|feature request) for\\?\\n\\ninput\\n"
36+
37+
packages:music:
38+
- "### Which (package|utils|package or utils) is this (bug
39+
report|feature request) for\\?\\n\\nmusic\\n"
40+
41+
packages:sound:
42+
- "### Which (package|utils|package or utils) is this (bug
43+
report|feature request) for\\?\\n\\nsound\\n"
44+
45+
utils:eslint-config:
46+
- "### Which (package|utils|package or utils) is this (bug
47+
report|feature request) for\\?\\n\\nstructures\\n"
48+
49+
utils:prettier-config:
50+
- "### Which (package|utils|package or utils) is this (bug
51+
report|feature request) for\\?\\n\\ui\\n"

.github/labeler.yml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
packages:asset-manager:
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- packages/asset-manager/*
5+
- packages/asset-manager/**/*
6+
7+
packages:common:
8+
- changed-files:
9+
- any-glob-to-any-file:
10+
- packages/common/*
11+
- packages/common/**/*
12+
13+
packages:config:
14+
- changed-files:
15+
- any-glob-to-any-file:
16+
- packages/config/*
17+
- packages/config/**/*
18+
19+
packages:core:
20+
- changed-files:
21+
- any-glob-to-any-file:
22+
- packages/core/*
23+
- packages/core/**/*
24+
25+
packages:ecs-client:
26+
- changed-files:
27+
- any-glob-to-any-file:
28+
- packages/ecs-client/*
29+
- packages/ecs-client/**/*
30+
31+
packages:ecs-lib:
32+
- changed-files:
33+
- any-glob-to-any-file:
34+
- packages/ecs-lib/*
35+
- packages/ecs-lib/**/*
36+
37+
packages:ecs-server:
38+
- changed-files:
39+
- any-glob-to-any-file:
40+
- packages/ecs-server/*
41+
- packages/ecs-server/**/*
42+
43+
packages:graphics-2d:
44+
- changed-files:
45+
- any-glob-to-any-file:
46+
- packages/graphics-2d/*
47+
- packages/graphics-2d/**/*
48+
49+
packages:input:
50+
- changed-files:
51+
- any-glob-to-any-file:
52+
- packages/input/*
53+
- packages/input/**/*
54+
55+
packages:music:
56+
- changed-files:
57+
- any-glob-to-any-file:
58+
- packages/music/*
59+
- packages/music/**/*
60+
61+
packages:sound:
62+
- changed-files:
63+
- any-glob-to-any-file:
64+
- packages/sound/*
65+
- packages/sound/**/*
66+
67+
utils:eslint-config:
68+
- changed-files:
69+
- any-glob-to-any-file:
70+
- utils/eslint-config/*
71+
- utils/eslint-config/**/*
72+
73+
utils:prettier-config:
74+
- changed-files:
75+
- any-glob-to-any-file:
76+
- utils/prettier-config/*
77+
- utils/prettier-config/**/*

.github/labels.yml

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
- name: "blocked"
2+
description: "This is blocked"
3+
color: "e92f1d"
4+
5+
- name: "bug"
6+
description: "Something isn't working"
7+
color: "d73a4a"
8+
9+
- name: "chore"
10+
description: "Changes that don't affect the codebase (eg. CI, docs)"
11+
color: "eba8cc"
12+
13+
- name: "ci"
14+
description: "Changes to our CI configuration files and scripts"
15+
color: "721cdb"
16+
17+
- name: "documentation"
18+
description: "Improvements or additions to documentation"
19+
color: "0075ca"
20+
21+
- name: "duplicate"
22+
description: "This issue or pull request already exists"
23+
color: "cfd3d7"
24+
25+
- name: "enhancement"
26+
description: "New feature or request"
27+
color: "a2eeef"
28+
29+
- name: "good first issue"
30+
description: "Good for newcomers"
31+
color: "7057ff"
32+
33+
- name: "help wanted"
34+
description: "Extra attention is needed"
35+
color: "008672"
36+
37+
- name: "invalid"
38+
description: "This doesn't seem right"
39+
color: "e4e669"
40+
41+
- name: "packages:asset-manager"
42+
description: "Related to AssetManager library"
43+
color: "aaa3dc"
44+
45+
- name: "packages:common"
46+
description: "Related to Common library"
47+
color: "aaa3dc"
48+
49+
- name: "packages:config"
50+
description: "Related to Config library"
51+
color: "aaa3dc"
52+
53+
- name: "packages:core"
54+
description: "Related to Core library"
55+
color: "aaa3dc"
56+
57+
- name: "packages:ecs-client"
58+
description: "Related to ECSClient library"
59+
color: "aaa3dc"
60+
61+
- name: "packages:ecs-lib"
62+
description: "Related to Abstract ECS library"
63+
color: "aaa3dc"
64+
65+
- name: "packages:ecs-server"
66+
description: "Related to ECSServer library"
67+
color: "aaa3dc"
68+
69+
- name: "packages:graphics-2d"
70+
description: "Related to Graphics2D library"
71+
color: "aaa3dc"
72+
73+
- name: "packages:input"
74+
description: "Related to Input library"
75+
color: "aaa3dc"
76+
77+
- name: "packages:music"
78+
description: "Related to Music library"
79+
color: "aaa3dc"
80+
81+
- name: "packages:sound"
82+
description: "Related to Sound library"
83+
color: "aaa3dc"
84+
85+
- name: "question"
86+
description: "Further information is requested"
87+
color: "d876e3"
88+
89+
- name: "refactor"
90+
description: "Code change that neither fixes a bug nor adds a feature"
91+
color: "a3f2e8"
92+
93+
- name: "tests"
94+
description: "Adding missing tests or correcting existing tests"
95+
color: "7f8f92"
96+
97+
- name: "utils:eslint-config"
98+
description: "Related to ESLint config"
99+
color: "606bdf"
100+
101+
- name: "utils:prettier-config"
102+
description: "Related to Prettier config"
103+
color: "606bdf"
104+
105+
- name: "wontfix"
106+
description: "This will not be worked on"
107+
color: "ffffff"

.github/workflows/issue-triage.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Issue Labeler"
2+
on:
3+
issues:
4+
types: [opened]
5+
jobs:
6+
issue-triage:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: github/issue-labeler@v3.4
10+
with:
11+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
12+
configuration-path: .github/issue-labeler.yml
13+
enable-versioned-regex: 0

.github/workflows/label-sync.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: "Label sync"
2+
on:
3+
schedule:
4+
- cron: "0 0 * * *"
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- main
9+
paths:
10+
- ".github/labels.yml"
11+
jobs:
12+
label-sync:
13+
name: Label sync
14+
runs-on: ubuntu-latest
15+
if: github.repository_owner == 'discordjs'
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v5
19+
20+
- name: Label sync
21+
uses: crazy-max/ghaction-github-labeler@v5
22+
with:
23+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr-triage.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: "PR Triage"
2+
on:
3+
pull_request_target:
4+
types:
5+
- opened
6+
- edited
7+
- reopened
8+
- synchronize
9+
jobs:
10+
label:
11+
name: Label
12+
if: github.event.action != 'edited'
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Label pull request
16+
uses: actions/labeler@v5
17+
with:
18+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
19+
sync-labels: true
20+
validate-title:
21+
name: Validate title
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Validate pull request title
25+
env:
26+
TITLE: ${{ github.event.pull_request.title }}
27+
run: |
28+
REGEX="^(revert: )?(feat|fix|docs|style|refactor|perf|test|build|ci|chore|types)(\\(.+\\))?!?: .{1,72}$"
29+
30+
echo "Title: \"$TITLE\""
31+
32+
if [[ ! "$TITLE" =~ $REGEX ]]; then
33+
exit 1
34+
fi

0 commit comments

Comments
 (0)