-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (41 loc) · 1.36 KB
/
issue-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
46
47
48
name: Send Organization Invite
on:
issues:
types: [opened, reopened]
permissions: write-all
jobs:
Dump_Github_Context:
runs-on: ubuntu-latest
steps:
- name: Dump Github context
run: echo '${{ toJSON(github.event) }}' | jq
shell: bash
Comment_on_Issue:
runs-on: ubuntu-latest
needs: Dump_Github_Context
steps:
- name: Add Comment
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.issue.number }}
body: |
Thank you for your interest in becoming a member in voninc :sparkles:
An invitation has been sent to your account! Please check your [organization page][1]
[1]: https://github.com/settings/organizations
Invite_to_Organization:
runs-on: ubuntu-latest
needs: Comment_on_Issue
steps:
- name: Invite User using Github CLI
run: |
gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
/orgs/${ORGANIZATION}/invitations \
-f invitee_id=${USERID} \
-f role='direct_member' \
env:
ORGANIZATION: ${{ github.event.organization.login }}
USERID: ${{ github.event.issue.user.id }}
GITHUB_TOKEN: ${{ secrets.TOKEN }}