Skip to content

Commit 6102303

Browse files
authored
Merge pull request #482 from yashksaini-coder/request-workflow
Request workflow
2 parents 6d697aa + f1f20a7 commit 6102303

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Request Access
3+
about: Submit this form to request read-only access to a private repository.
4+
title: "[Access Request] Request access for {username}"
5+
labels: access-request
6+
assignees: ''
7+
8+
---
9+
10+
## Request Access to Private Repository
11+
12+
Thank you for your interest in accessing our private repository! Please fill out the required details below to submit your request.
13+
14+
### GitHub Username
15+
Please provide your GitHub username. Ensure it's accurate so we can process your request.
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/Job-Seeker/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)