-
Notifications
You must be signed in to change notification settings - Fork 164
125 lines (109 loc) · 4.37 KB
/
greet.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Comment and Label on Issue Opened
on:
issues:
types:
- opened
jobs:
comment_and_label:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Add comment
uses: actions/github-script@v4
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
script: |
const commentAuthor = context.payload.issue.user.login;
const commentBody = `Hey @${commentAuthor} ! \n Thank you for raising an issue 💗 \n You can self assign the issue by commenting /assign in comment 😀 \n Make sure you follow [CODE OF CONDUCT](https://github.com/GameSphere-MultiPlayer/GameSphere/blob/main/.github/CODE_OF_CONDUCT.md) `;
const { owner, repo, number } = context.issue;
await github.issues.createComment({
owner: owner,
repo: repo,
issue_number: number,
body: commentBody
});
- name: Add label if issue body contains "GSSoC24"
id: check_label_gs_soc24
run: |
if grep -qE "GSSoC24" <<< "${{ github.event.issue.body }}"; then
echo "::set-output name=add_label_gs_soc24::true"
else
echo "::set-output name=add_label_gs_soc24::false"
fi
- name: Add label "GSSoC24"
if: ${{ steps.check_label_gs_soc24.outputs.add_label_gs_soc24 == 'true' }}
uses: actions/github-script@v4
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
script: |
const { owner, repo, number } = context.issue;
await github.issues.addLabels({
owner: owner,
repo: repo,
issue_number: number,
labels: ["gssoc"]
});
- name: Add label if issue body contains "GSSoC23"
id: check_label_gs_soc23
run: |
if grep -qE "GSSoC23" <<< "${{ github.event.issue.body }}"; then
echo "::set-output name=add_label_gs_soc23::true"
else
echo "::set-output name=add_label_gs_soc23::false"
fi
- name: Add label "GSSoC23"
if: ${{ steps.check_label_gs_soc23.outputs.add_label_gs_soc23 == 'true' }}
uses: actions/github-script@v4
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
script: |
const { owner, repo, number } = context.issue;
await github.issues.addLabels({
owner: owner,
repo: repo,
issue_number: number,
labels: ["GSSoC23"]
});
- name: Add label if issue body contains "hacktoberfest"
id: check_label_hacktoberfest
run: |
if grep -qE "hacktoberfest" <<< "${{ github.event.issue.body }}"; then
echo "::set-output name=add_label_hacktoberfest::true"
else
echo "::set-output name=add_label_hacktoberfest::false"
fi
- name: Add label "hacktoberfest"
if: ${{ steps.check_label_hacktoberfest.outputs.add_label_hacktoberfest == 'true' }}
uses: actions/github-script@v4
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
script: |
const { owner, repo, number } = context.issue;
await github.issues.addLabels({
owner: owner,
repo: repo,
issue_number: number,
labels: ["hacktoberfest"]
});
- name: Add label if issue body contains "IWOC2024"
id: check_label_iwoc
run: |
if grep -qE "IWOC2024" <<< "${{ github.event.issue.body }}"; then
echo "::set-output name=add_label_iwoc::true"
else
echo "::set-output name=add_label_iwoc::false"
fi
- name: Add label "IWOC2024"
if: ${{ steps.check_label_iwoc.outputs.add_label_iwoc == 'true' }}
uses: actions/github-script@v4
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
script: |
const { owner, repo, number } = context.issue;
await github.issues.addLabels({
owner: owner,
repo: repo,
issue_number: number,
labels: ["IWOC2024"]
});