Skip to content

Commit

Permalink
Merge pull request #482 from yashksaini-coder/request-workflow
Browse files Browse the repository at this point in the history
Request workflow
  • Loading branch information
sanjay-kv authored Jan 8, 2025
2 parents 6d697aa + f1f20a7 commit 6102303
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE/request-access.md
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.
27 changes: 27 additions & 0 deletions .github/workflows/private-access.yml
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."

0 comments on commit 6102303

Please sign in to comment.