-
Notifications
You must be signed in to change notification settings - Fork 839
101 lines (88 loc) · 3.77 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
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/kunjgit/GameZone/blob/main/.github/CODE_OF_CONDUCT.md) and [CONTRIBUTING GUIDELINES](https://github.com/kunjgit/GameZone/blob/main/.github/CONTRIBUTING_GUIDELINE.md) 🚀 \n Don’t Forget to ⭐ our [GameZone🎮](https://github.com/kunjgit/GameZone)\n Make sure you join our [Discord🕹️](https://discord.gg/fgwk4XZfxG) `;
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 "GSSoC23"
id: check_label_gs_soc
run: |
if grep -qE "GSSoC23" <<< "${{ github.event.issue.body }}"; then
echo "::set-output name=add_label_gs_soc::true"
else
echo "::set-output name=add_label_gs_soc::false"
fi
- name: Add label "GSSoC23"
if: ${{ steps.check_label_gs_soc.outputs.add_label_gs_soc == '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"]
});