Skip to content

Commit 1b00717

Browse files
author
yashksaini-coder
committed
feat: 🎸 Update private access workflow to send GitHub collaborator invites
1 parent 25c5e8c commit 1b00717

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed
Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
name: Process Access Requests
1+
name: Send GitHub Collaborator Invite from Issue
22

33
on:
44
issues:
5-
types:
6-
- closed
5+
types: [closed]
76

87
jobs:
9-
invite-user:
8+
send-invite:
9+
1010
if: contains(github.event.issue.labels.*.name, 'access-request')
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- name: Invite User to Private Repo
15-
env:
16-
TOKEN: ${{ secrets.GITHUB_TOKEN }}
17-
USERNAME: ${{ github.event.issue.user.login }}
18-
run: |
19-
curl -X PUT \
20-
-H "Authorization: token $TOKEN" \
21-
-H "Accept: application/vnd.github.v3+json" \
22-
https://api.github.com/repos/recodehive/Opensource-practice/collaborators/${USERNAME} \
23-
-d '{"permission": "pull"}'
14+
- name: Checkout repository
15+
uses: actions/checkout@v3
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v3
19+
with:
20+
node-version: 16
2421

25-
- name: Handle Errors
26-
if: failure()
27-
run: echo "An error occurred while processing the request."
22+
- name: Invite User to Private Repo
23+
env:
24+
TOKEN: ${{ secrets.GH_TOKEN }}
25+
USERNAME: ${{ github.event.issue.user.login }}
26+
run: |
27+
npm install
28+
node scripts/invite.js $USERNAME $TOKEN

0 commit comments

Comments
 (0)