Skip to content

Commit 76af284

Browse files
author
yashksaini-coder
committed
ci: 🎡 Invite request workflow for Read access to Repository
1 parent e2c7042 commit 76af284

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Process Access Requests
2+
3+
on:
4+
issues:
5+
types:
6+
- closed
7+
8+
jobs:
9+
invite-user:
10+
if: contains(github.event.issue.labels.*.name, 'access-request')
11+
runs-on: ubuntu-latest
12+
13+
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/REPO-NAME/collaborators/${USERNAME} \
23+
-d '{"permission": "pull"}'
24+
25+
- name: Handle Errors
26+
if: failure()
27+
run: echo "An error occurred while processing the request."

0 commit comments

Comments
 (0)