From e2c7042a5cf7c1dd6df368bb2a9743bc3ab4434d Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Wed, 8 Jan 2025 16:11:12 +0530 Subject: [PATCH 1/3] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Add=20request=20iss?= =?UTF-8?q?ue=20template?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/request-access.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/request-access.md diff --git a/.github/ISSUE_TEMPLATE/request-access.md b/.github/ISSUE_TEMPLATE/request-access.md new file mode 100644 index 0000000..3d99464 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/request-access.md @@ -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. \ No newline at end of file From 76af284fa726389b03e9624732998a09b03aca9c Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Wed, 8 Jan 2025 16:12:21 +0530 Subject: [PATCH 2/3] =?UTF-8?q?ci:=20=F0=9F=8E=A1=20Invite=20request=20wor?= =?UTF-8?q?kflow=20for=20Read=20access=20to=20Repository?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/private-access.yml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .github/workflows/private-access.yml diff --git a/.github/workflows/private-access.yml b/.github/workflows/private-access.yml new file mode 100644 index 0000000..24d2476 --- /dev/null +++ b/.github/workflows/private-access.yml @@ -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/REPO-NAME/collaborators/${USERNAME} \ + -d '{"permission": "pull"}' + + - name: Handle Errors + if: failure() + run: echo "An error occurred while processing the request." \ No newline at end of file From f1f20a756350089b12d972b1e05add41091c457a Mon Sep 17 00:00:00 2001 From: yashksaini-coder Date: Wed, 8 Jan 2025 17:01:15 +0530 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Update=20repository?= =?UTF-8?q?=20name=20in=20private=20access=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/private-access.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/private-access.yml b/.github/workflows/private-access.yml index 24d2476..965a417 100644 --- a/.github/workflows/private-access.yml +++ b/.github/workflows/private-access.yml @@ -19,7 +19,7 @@ jobs: curl -X PUT \ -H "Authorization: token $TOKEN" \ -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/recodehive/REPO-NAME/collaborators/${USERNAME} \ + https://api.github.com/repos/recodehive/Job-Seeker/collaborators/${USERNAME} \ -d '{"permission": "pull"}' - name: Handle Errors