Skip to content

Commit 34bd563

Browse files
authored
Create invite.yml
1 parent 4b6710a commit 34bd563

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/invite.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Automate Invitation
2+
3+
on:
4+
issues:
5+
types: [labeled]
6+
7+
jobs:
8+
handle_label:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Check if Label is 'invite me to the community'
13+
id: check_label
14+
run: |
15+
if [[ "${{ github.event.label.name }}" != "invite me to the community" ]]; then
16+
echo "Label is not 'invite me to the community'. Exiting."
17+
exit 0
18+
fi
19+
20+
- name: Close Original Issue in Support Repository
21+
if: ${{ steps.check_label.outcome == 'success' }}
22+
uses: actions/github-script@v5
23+
with:
24+
github-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
25+
script: |
26+
const issue = context.payload.issue;
27+
await github.rest.issues.update({
28+
owner: context.repo.owner,
29+
repo: context.repo.repo,
30+
issue_number: issue.number,
31+
state: 'closed'
32+
});
33+
34+
- name: Invite on Label
35+
if: ${{ steps.check_label.outcome == 'success' }}
36+
uses: vj-abigo/[email protected]
37+
with:
38+
organization: Recode-Hive
39+
label: invite me to the community
40+
repo-token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
41+
comment: |
42+
<b>Invitation sent to join the GitHub Organisation. Welcome to the community 🎉</b><br><br>
43+
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/Recode-Hive/people<br><br>
44+
env:
45+
INVITE_TOKEN: ${{ secrets.INVITE_TOKEN }}

0 commit comments

Comments
 (0)