-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #482 from yashksaini-coder/request-workflow
Request workflow
- Loading branch information
Showing
2 changed files
with
42 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
name: Request Access | ||
about: Submit this form to request read-only access to a private repository. | ||
title: "[Access Request] Request access for {username}" | ||
labels: access-request | ||
assignees: '' | ||
|
||
--- | ||
|
||
## Request Access to Private Repository | ||
|
||
Thank you for your interest in accessing our private repository! Please fill out the required details below to submit your request. | ||
|
||
### GitHub Username | ||
Please provide your GitHub username. Ensure it's accurate so we can process your request. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Process Access Requests | ||
|
||
on: | ||
issues: | ||
types: | ||
- closed | ||
|
||
jobs: | ||
invite-user: | ||
if: contains(github.event.issue.labels.*.name, 'access-request') | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Invite User to Private Repo | ||
env: | ||
TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
USERNAME: ${{ github.event.issue.user.login }} | ||
run: | | ||
curl -X PUT \ | ||
-H "Authorization: token $TOKEN" \ | ||
-H "Accept: application/vnd.github.v3+json" \ | ||
https://api.github.com/repos/recodehive/Job-Seeker/collaborators/${USERNAME} \ | ||
-d '{"permission": "pull"}' | ||
- name: Handle Errors | ||
if: failure() | ||
run: echo "An error occurred while processing the request." |