Repository navigation
64 lines (54 loc) · 1.78 KB
/
Copy pathlabeller.yml
File metadata and controls
64 lines (54 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: NSOC Label
on:
issues:
types: [opened]
permissions:
contents: write
issues: write
jobs:
manage-issues:
runs-on: ubuntu-latest
steps:
- name: Ensure NSOC label exists (Orange)
uses: actions/github-script@v6
with:
script: |
const labelName = "NSoC'26";
const color = "af40e3";
try {
await github.rest.issues.getLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: labelName
});
await github.rest.issues.updateLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: labelName,
color: color
});
} catch {
await github.rest.issues.createLabel({
owner: context.repo.owner,
repo: context.repo.repo,
name: labelName,
color: color,
description: "For issues and PRs which are a part of the Nexus Spring of Code open source event"
});
}
- name: Detect NSOC variations and apply label
uses: actions/github-script@v6
with:
script: |
const issue = context.payload.issue;
const title = issue.title.toLowerCase();
const keywords = ["nsoc", "nsoc26", "nsoc'26", "nsoc 26", "nsoc-26", "NSOC'26", "NSoC'26"];
const isNSOC = keywords.some(k => title.includes(k));
if (isNSoC) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
labels: ["NSoC'26"]
});
}