Skip to content

Commit 6389997

Browse files
committed
Port labeling system from build framework
1 parent 43bea4a commit 6389997

4 files changed

Lines changed: 231 additions & 0 deletions

File tree

.github/labeler.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# This configures label matching for PR's.
2+
#
3+
# The keys are labels, and the values are lists of minimatch patterns
4+
# to which those labels apply.
5+
#
6+
# NOTE: This can only add labels, not remove them.
7+
# NOTE: Due to YAML syntax limitations, patterns or labels which start
8+
# with a character that is part of the standard YAML syntax must be
9+
# quoted.
10+
#
11+
# Please keep the labels sorted and deduplicated.
12+
13+
"Scripts":
14+
- all:
15+
- changed-files:
16+
- any-glob-to-any-file: ['lib/armbian-configng/*']
17+
18+
"GitHub Actions":
19+
- all:
20+
- changed-files:
21+
- any-glob-to-any-file: ['.github/workflows/**/*']
22+
23+
"GitHub":
24+
- all:
25+
- changed-files:
26+
- any-glob-to-any-file: ['.github/**/*']
27+
- all-globs-to-any-file: ['!.github/workflows/**/*']
28+
29+
"Unit Tests":
30+
- all:
31+
- changed-files:
32+
- any-glob-to-any-file: ['tests/*']
33+
34+
# Add 'Documentation' label to any change to .md files within the entire repository
35+
"Documentation":
36+
- changed-files:
37+
- any-glob-to-any-file: '**/*.md'

.github/labels.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
- name: "02"
2+
color: "76B4D9"
3+
description: "Milestone: First quarter release"
4+
- name: "05"
5+
color: "AADB79"
6+
description: "Milestone: Second quarter release"
7+
- name: "08"
8+
color: "4B649F"
9+
description: "Milestone: Third quarter release"
10+
- name: "11"
11+
color: "D58125"
12+
description: "Milestone: Fourth quarter release"
13+
- name: "Backlog"
14+
color: "d4c5f9"
15+
description: "Stalled work that needs to be completed"
16+
- name: "Breaking change"
17+
color: "f4bd13"
18+
description: "Can potentially break core functionality"
19+
- name: "Bug"
20+
color: "F92C01"
21+
description: "Something isn't working as it should"
22+
- name: "Bugfix"
23+
color: "F92C01"
24+
description: "Pull request is fixing a bug"
25+
- name: "Dependencies"
26+
color: "0366d6"
27+
description: "Pull requests that update a dependency"
28+
- name: "Discussion"
29+
color: "EDFFE3"
30+
description: "Being discussed - Voice your opinions :)"
31+
- name: "Duplicate"
32+
color: "f4bd13"
33+
description: "Issue is already present"
34+
- name: "Feature Request"
35+
color: "1aac63"
36+
description: "Feature suggestion"
37+
- name: "Good first issue"
38+
color: "ffb3ff"
39+
description: "Feel free to contribute :) "
40+
- name: "Not framework bug"
41+
color: "CD456C"
42+
description: "Bug in 3rd party component"
43+
- name: "Python"
44+
color: "2b67c6"
45+
description: "Pull requests that update Python code "
46+
- name: "User error"
47+
color: "CD456C"
48+
description: "A mistake that is made by the user"
49+
- name: "size/small"
50+
color: "ededed"
51+
description: "PR with less then 50 lines"
52+
- name: "size/medium"
53+
color: "ededed"
54+
description: "PR with more then 50 and less then 250 lines"
55+
- name: "size/large"
56+
color: "ededed"
57+
description: "PR with 250 lines or more"
58+
- name: "Task/To-Do"
59+
color: "2f95f1"
60+
description: "Project management: To-Do or task(s) someone is working on"
61+
- name: "Desktop"
62+
color: "bfd4f2"
63+
description: "Graphical user interface"
64+
- name: "Hardware"
65+
color: "bfd4f2"
66+
description: "Hardware related like kernel, U-Boot, ..."
67+
- name: "Framework"
68+
color: "bfd4f2"
69+
description: "Framework components"
70+
- name: "BSP"
71+
color: "bfd4f2"
72+
description: "Board Support Packages"
73+
- name: "GitHub Actions"
74+
color: "bfd4f2"
75+
description: "GitHub Actions code"
76+
- name: "GitHub"
77+
color: "bfd4f2"
78+
description: "GitHub-related changes like labels, templates, ..."
79+
- name: "Patches"
80+
color: "bfd4f2"
81+
description: "Patches related to kernel, U-Boot, ..."
82+
- name: "Documentation"
83+
color: "bfd4f2"
84+
description: "Documentation changes or additions"
85+
- name: "Work in progress"
86+
color: "29E414"
87+
description: "Unfinished / work in progress"
88+
- name: "Ready to merge"
89+
color: "1d7136"
90+
description: "Reviewed, tested and ready for merge"
91+
- name: "Help needed"
92+
color: "EA1BCE"
93+
description: "We need your involvement"
94+
- name: "Needs review"
95+
color: "AEE054"
96+
description: "Seeking for review"
97+
- name: "Can be closed?"
98+
color: "9b75fc"
99+
description: "Ping developers on stalled issue / PR"
100+
- name: "Build"
101+
color: "5ee3d0"
102+
description: "Executing build train (permission needed)"
103+
- name: "Needs Documentation"
104+
color: "4FD1EF"
105+
description: "New feature needs documentation entry"
106+
- name: "Documentation finished"
107+
color: "0052CC"
108+
description: "New feature was properly added to docs"
109+
- name: "Improper usage"
110+
color: "CD456C"
111+
description: "Provided input is not in the expected data format or structure"
112+
- name: "Giveaway"
113+
color: "DA4C13"
114+
description: "Code completition was selected to enter contributors giveaway"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Sync Labels from YAML
2+
run-name: Sync Labels from YML on ${{ github.event_name }}
3+
4+
on:
5+
workflow_dispatch:
6+
push:
7+
branches:
8+
- "main"
9+
paths:
10+
- ".github/labels.yml"
11+
pull_request:
12+
paths:
13+
- ".github/labels.yml"
14+
15+
jobs:
16+
labeler:
17+
permissions:
18+
contents: read # for actions/labeler to determine modified files
19+
pull-requests: write # for actions/labeler to add labels to PRs
20+
issues: write # for actions/labeler to add labels to issues
21+
22+
if: ${{ github.repository_owner == 'Armbian' }}
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
29+
- name: Run Labeler
30+
uses: crazy-max/ghaction-github-labeler@v5
31+
with:
32+
github-token: ${{ secrets.GITHUB_TOKEN }}
33+
yaml-file: .github/labels.yml
34+
dry-run: ${{ github.event_name == 'pull_request' }}
35+
exclude: |
36+
Maintenance*
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Automatic Pull Request Labeling
2+
run-name: 'Set labels - PR #${{ github.event.pull_request.number }} ("${{ github.event.pull_request.title }}")'
3+
#
4+
# Set labels for pull requests automatically based on size (modified via job 'label-size') and file categories (modified via .github/labeler)
5+
#
6+
7+
on:
8+
- pull_request_target
9+
10+
jobs:
11+
label-category:
12+
permissions:
13+
contents: read # for actions/labeler to determine modified files
14+
pull-requests: write # for actions/labeler to add labels to PRs
15+
16+
name: "Category labels"
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/labeler@v5
22+
with:
23+
repo-token: "${{ secrets.GITHUB_TOKEN }}"
24+
25+
label-size:
26+
permissions:
27+
contents: read # for pascalgn/size-label-action to determine modified files
28+
pull-requests: write # for pascalgn/size-label-action to add labels to PRs
29+
30+
name: "Size label"
31+
runs-on: ubuntu-latest
32+
33+
steps:
34+
- name: size-label
35+
uses: "pascalgn/size-label-action@v0.5.4"
36+
env:
37+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
38+
with:
39+
sizes: >
40+
{
41+
"0": "small",
42+
"50": "medium",
43+
"250": "large"
44+
}

0 commit comments

Comments
 (0)