-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.57 KB
/
add_labels.yml
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
name: Label on Issue Open
on:
issues:
types:
- opened
jobs:
label_on_issue_open:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Add Labels
uses: actions/github-script@v4
with:
github-token: ${{ secrets.DEMO_TOKEN }}
script: |
const issueBody = context.payload.issue.body.toLowerCase();
const addLabels = (labels) => {
github.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: labels
});
}
if (issueBody.includes('hacktoberfest')) {
addLabels(['hacktoberfest']);
}
if (issueBody.includes('critical')) {
addLabels(['critical']);
}
if (issueBody.includes('minor')) {
addLabels(['minor']);
}
if (issueBody.includes('enhancement')) {
addLabels(['enhancement']);
}
if (issueBody.includes('descriptive statistics')) {
addLabels(['descriptive-statistics']);
}
if (issueBody.includes('data visualization')) {
addLabels(['data-visualization']);
}
if (issueBody.includes('machine learning')) {
addLabels(['machine-learning']);
}
if (issueBody.includes('other')) {
addLabels(['other']);
}