Skip to content

Commit 1a6f63a

Browse files
Merge pull request #360 from aniket866/patch-1
Add GitHub Actions workflow for NSOC label management
2 parents bcad5f3 + 6202c3a commit 1a6f63a

1 file changed

Lines changed: 64 additions & 0 deletions

File tree

‎.github/workflows/labeller.yml‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: NSOC Label
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
7+
permissions:
8+
contents: write
9+
issues: write
10+
11+
jobs:
12+
manage-issues:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Ensure NSOC label exists (Orange)
17+
uses: actions/github-script@v6
18+
with:
19+
script: |
20+
const labelName = "NSOC'26";
21+
const color = "FFA500";
22+
23+
try {
24+
await github.rest.issues.getLabel({
25+
owner: context.repo.owner,
26+
repo: context.repo.repo,
27+
name: labelName
28+
});
29+
30+
await github.rest.issues.updateLabel({
31+
owner: context.repo.owner,
32+
repo: context.repo.repo,
33+
name: labelName,
34+
color: color
35+
});
36+
37+
} catch {
38+
await github.rest.issues.createLabel({
39+
owner: context.repo.owner,
40+
repo: context.repo.repo,
41+
name: labelName,
42+
color: color,
43+
description: "NSOC 2026 Issues"
44+
});
45+
}
46+
47+
- name: Detect NSOC variations and apply label
48+
uses: actions/github-script@v6
49+
with:
50+
script: |
51+
const issue = context.payload.issue;
52+
const title = issue.title.toLowerCase();
53+
54+
const keywords = ["nsoc", "nsoc26", "nsoc'26", "nsoc 26", "nsoc-26"];
55+
const isNSOC = keywords.some(k => title.includes(k));
56+
57+
if (isNSOC) {
58+
await github.rest.issues.addLabels({
59+
owner: context.repo.owner,
60+
repo: context.repo.repo,
61+
issue_number: issue.number,
62+
labels: ["NSOC'26"]
63+
});
64+
}

0 commit comments

Comments
 (0)