-
Notifications
You must be signed in to change notification settings - Fork 1
45 lines (40 loc) · 1.64 KB
/
invite.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
name: Automate Invitation
on:
issues:
types: [labeled]
jobs:
handle_label:
runs-on: ubuntu-latest
steps:
- name: Check if Label is 'invite me to the community'
id: check_label
run: |
if [[ "${{ github.event.label.name }}" != "invite me to the community" ]]; then
echo "Label is not 'invite me to the community'. Exiting."
exit 0
fi
- name: Close Original Issue in Support Repository
if: ${{ steps.check_label.outcome == 'success' }}
uses: actions/github-script@v5
with:
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
script: |
const issue = context.payload.issue;
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue.number,
state: 'closed'
});
- name: Invite on Label
if: ${{ steps.check_label.outcome == 'success' }}
uses: vj-abigo/[email protected]
with:
organization: recodehive
label: invite me to the community
repo-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
comment: |
<b>Invitation sent to join the GitHub Organisation. Welcome to the community 🎉</b><br><br>
Don't forget after accepting to make it public so it appears on your GitHub profile for everyone else to see. You can do this by finding your name in the GitHub organisation list and change the dropdown to public https://github.com/orgs/recodehive/people<br><br>
env:
INVITE_TOKEN: ${{ secrets.INVITE_TOKEN }}