-
Notifications
You must be signed in to change notification settings - Fork 1
116 lines (101 loc) · 4.5 KB
/
Copy pathProcessJoinApplication.yml
File metadata and controls
116 lines (101 loc) · 4.5 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
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
name: Process Join Application
on:
issues:
types:
- labeled
permissions:
issues: write
jobs:
ProcessJoinApplication:
runs-on: ubuntu-latest
steps:
- name: Check Label
id: check-label
uses: actions/github-script@v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const labels = context.payload.issue.labels.map(label => label.name);
let action = "none";
if (!labels.includes("· Join-application")) {
action = "none";
} else if (labels.includes("√ Approved")) {
action = "approved";
} else if (labels.includes("× Rejected")) {
action = "rejected";
} else if (labels.includes("⌛ Pending")) {
action = "none";
} else {
action = "welcome";
}
console.log(`Issue Action: ${action}`);
core.setOutput("run-actions", action);
- name: Welcome - Send Welcome Message
if: steps.check-label.outputs.run-actions == 'welcome'
uses: actions/github-script@v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `我们已经收到了您的申请,并会尽快处理,请耐心等待。
另请注意,我们可能会要求您提交更多信息。因此,请关注您的 GitHub 绑定邮箱通知。
若您未在 24 小时内回复我们的要求,我们将关闭您的申请,不过您还可以再次提交。`
});
- name: Approved - Send Approved Message
if: steps.check-label.outputs.run-actions == 'approved'
uses: actions/github-script@v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: '恭喜您,我们已经同意您的申请!欢迎加入 IT Craft Development Team!'
});
- name: Approved - Close Issue As Completed
if: steps.check-label.outputs.run-actions == 'approved'
uses: actions/github-script@v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
state: 'closed',
state_reason: 'completed'
});
- name: Rejected - Send Rejected Message
if: steps.check-label.outputs.run-actions == 'rejected'
uses: actions/github-script@v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `感谢您对 IT Craft Development Team 的兴趣和支持。我们很高兴收到您的加入申请,但很遗憾地通知您,您的申请没有通过。
我们寻找具有创新能力或与我们志同道合的成员。根据您提交的申请,我们认为您的思想或技能水平还不符合我们的要求。我们建议您在以下方面提高自己:
- 掌握至少一种主流编程语言,如 Python、Java、Rust 等。
- 了解常用的软件开发工具,如 VSCode、PyCharm、IDEA 等。
- 参与一些有创新性的项目,展示您的解决问题和协作能力。
我们对您的未来发展表示祝福,并希望您能够继续关注我们的团队动态。如果您有任何疑问或反馈,请随时联系我们。`
});
- name: Rejected - Close Issue As Not Planned
if: steps.check-label.outputs.run-actions == 'rejected'
uses: actions/github-script@v8
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
state: 'closed',
state_reason: 'not planned'
});