File tree Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Expand file tree Collapse file tree 1 file changed +4
-14
lines changed Original file line number Diff line number Diff line change 11name : Grant Access to Private Repo
22
33on :
4- workflow_dispatch :
5- inputs :
6- username :
7- description : ' GitHub Username'
8- required : true
4+ watch :
5+ types : [started]
96
107jobs :
118 check_star_and_grant_access :
129 runs-on : ubuntu-latest
1310 steps :
14- - name : Check if user has starred the repo
15- id : check_star
16- run : |
17- curl -s https://api.github.com/repos/hamsadev/EmbeddedC-Tutorials-and-Challenges/stargazers | grep ${{ github.event.inputs.username }} || exit 1
18-
1911 - name : Add user to private repo
20- if : success()
2112 run : |
2213 curl -X PUT -H "Authorization: token ${{ secrets.GH_TOKEN }}" \
2314 -H "Accept: application/vnd.github.v3+json" \
24- https://api.github.com/repos/hamsadev/EmbeddedC-Solutions/collaborators/${{ github.event.inputs.username }} \
15+ https://api.github.com/repos/hamsadev/EmbeddedC-Solutions/collaborators/${{ github.event.sender.login }} \
2516 -d '{"permission":"pull"}'
2617
2718 - name : Send confirmation
28- if : success()
29- run : echo "Access granted to private repository for user ${{ github.event.inputs.username }}."
19+ run : echo "Access granted to private repository (EmbeddedC-Solutions) for user ${{ github.event.sender.login }}."
You can’t perform that action at this time.
0 commit comments