forked from steam-bell-92/python-mini-project
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.22 KB
/
Copy pathgssoc-labeler.yml
File metadata and controls
45 lines (38 loc) · 1.22 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
name: GSSoC Labeler
on:
issues:
types: [opened, edited]
pull_request_target:
types: [opened, edited]
jobs:
label_gssoc:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: Check and add GSSoC label
uses: actions/github-script@v7
with:
script: |
let bodyText = "";
let issueNum = null;
if (context.payload.issue?.body) {
bodyText = context.payload.issue.body;
issueNum = context.payload.issue.number;
}
else if (context.payload.pull_request?.body) {
bodyText = context.payload.pull_request.body;
issueNum = context.payload.pull_request.number;
}
const isGSSoC =
bodyText.includes("[x] I am participating in GSSoC 2026") ||
bodyText.includes("[X] I am participating in GSSoC 2026");
if (isGSSoC && issueNum) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNum,
labels: ["gssoc:approved"],
});
}