Skip to content

Commit 4147c51

Browse files
Merge pull request #540 from devanshi14malhotra/add-gssoc-labels
Add gssoc labels
2 parents 8fc755f + 622d286 commit 4147c51

2 files changed

Lines changed: 122 additions & 0 deletions

File tree

‎.github/labels.yml‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
- name: "quality:clean"
2+
color: "c5f0ed"
3+
description: "PR follows all coding standards and is well-structured (for GSSoC'26)"
4+
- name: "quality:exceptional"
5+
color: "c5f0ed"
6+
description: "PR goes above and beyond in terms of quality and optimization (for GSSoC'26)"
7+
- name: "type:docs"
8+
color: "f1f2f6"
9+
description: "Additions or updates to documentation (for GSSoC'26)"
10+
- name: "type:testing"
11+
color: "f1f2f6"
12+
description: "Adding or improving tests (for GSSoC'26)"
13+
- name: "type:accessibility"
14+
color: "f1f2f6"
15+
description: "Improvements related to web accessibility (for GSSoC'26)"
16+
- name: "type:performance"
17+
color: "f1f2f6"
18+
description: "Changes that improve speed or resource usage (for GSSoC'26)"
19+
- name: "type:security"
20+
color: "f1f2f6"
21+
description: "Security-related fixes or enhancements (for GSSoC'26)"
22+
- name: "type:design"
23+
color: "f1f2f6"
24+
description: "Changes to UI, layout, or visual elements (for GSSoC'26)"
25+
- name: "type:refactor"
26+
color: "f1f2f6"
27+
description: "Code changes that neither fix a bug nor add a feature (for GSSoC'26)"
28+
- name: "type:devops"
29+
color: "f1f2f6"
30+
description: "Changes to CI/CD, build scripts, or infrastructure (for GSSoC'26)"
31+
- name: "type:bug"
32+
color: "f1f2f6"
33+
description: "Fixes for identified issues or errors (for GSSoC'26)"
34+
- name: "type:feature"
35+
color: "f1f2f6"
36+
description: "Introduction of new functionality (for GSSoC'26)"
37+
- name: "gssoc:approved"
38+
color: "c5f0ed"
39+
description: "PR has been reviewed and is eligible for GSSoC points (for GSSoC'26)"
40+
- name: "gssoc:invalid"
41+
color: "ffcccb"
42+
description: "PR does not meet requirements or is out of scope (for GSSoC'26)"
43+
- name: "gssoc:spam"
44+
color: "ffcccb"
45+
description: "PR is low-effort or automated spam (for GSSoC'26)"
46+
- name: "gssoc:ai-slop"
47+
color: "ffcccb"
48+
description: "PR contains low-quality AI-generated content (for GSSoC'26)"

‎.github/workflows/labels-setup.yml‎

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Setup GSSOC Labels
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- '.github/workflows/labels-setup.yml'
10+
11+
jobs:
12+
setup-labels:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Create or Update Labels
16+
uses: actions/github-script@v6
17+
with:
18+
script: |
19+
const labels = [
20+
// QUALITY (OPTIONAL) - Teal
21+
{ name: "quality:clean", color: "c5f0ed", description: "PR follows all coding standards and is well-structured (for GSSoC'26)" },
22+
{ name: "quality:exceptional", color: "c5f0ed", description: "PR goes above and beyond in terms of quality and optimization (for GSSoC'26)" },
23+
24+
// TYPE BONUS (OPTIONAL) - Gray
25+
{ name: "type:docs", color: "f1f2f6", description: "Additions or updates to documentation (for GSSoC'26)" },
26+
{ name: "type:testing", color: "f1f2f6", description: "Adding or improving tests (for GSSoC'26)" },
27+
{ name: "type:accessibility", color: "f1f2f6", description: "Improvements related to web accessibility (for GSSoC'26)" },
28+
{ name: "type:performance", color: "f1f2f6", description: "Changes that improve speed or resource usage (for GSSoC'26)" },
29+
{ name: "type:security", color: "f1f2f6", description: "Security-related fixes or enhancements (for GSSoC'26)" },
30+
{ name: "type:design", color: "f1f2f6", description: "Changes to UI, layout, or visual elements (for GSSoC'26)" },
31+
{ name: "type:refactor", color: "f1f2f6", description: "Code changes that neither fix a bug nor add a feature (for GSSoC'26)" },
32+
{ name: "type:devops", color: "f1f2f6", description: "Changes to CI/CD, build scripts, or infrastructure (for GSSoC'26)" },
33+
{ name: "type:bug", color: "f1f2f6", description: "Fixes for identified issues or errors (for GSSoC'26)" },
34+
{ name: "type:feature", color: "f1f2f6", description: "Introduction of new functionality (for GSSoC'26)" },
35+
36+
// VALIDATION (ADMIN DECIDES)
37+
{ name: "gssoc:approved", color: "c5f0ed", description: "PR has been reviewed and is eligible for GSSoC points (for GSSoC'26)" },
38+
{ name: "gssoc:invalid", color: "ffcccb", description: "PR does not meet requirements or is out of scope (for GSSoC'26)" },
39+
{ name: "gssoc:spam", color: "ffcccb", description: "PR is low-effort or automated spam (for GSSoC'26)" },
40+
{ name: "gssoc:ai-slop", color: "ffcccb", description: "PR contains low-quality AI-generated content (for GSSoC'26)" },
41+
];
42+
43+
for (const label of labels) {
44+
try {
45+
const { data: existingLabel } = await github.rest.issues.getLabel({
46+
owner: context.repo.owner,
47+
repo: context.repo.repo,
48+
name: label.name
49+
});
50+
51+
console.log(`Updating label: ${label.name}`);
52+
await github.rest.issues.updateLabel({
53+
owner: context.repo.owner,
54+
repo: context.repo.repo,
55+
name: label.name,
56+
new_name: label.name,
57+
color: label.color,
58+
description: label.description
59+
});
60+
} catch (error) {
61+
if (error.status === 404) {
62+
console.log(`Creating label: ${label.name}`);
63+
await github.rest.issues.createLabel({
64+
owner: context.repo.owner,
65+
repo: context.repo.repo,
66+
name: label.name,
67+
color: label.color,
68+
description: label.description
69+
});
70+
} else {
71+
console.error(`Error processing label ${label.name}:`, error);
72+
}
73+
}
74+
}

0 commit comments

Comments
 (0)