[Access Request] Request access for space-coder-ai #6
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
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/Opensource-practice/collaborators/${USERNAME} \ | |
-d '{"permission": "pull"}' | |
- name: Handle Errors | |
if: failure() | |
run: echo "An error occurred while processing the request." |