GitHub API How to check if user has write access to a repository

前端 未结 2 1288
别那么骄傲
别那么骄傲 2021-02-05 22:24

I currently have a bot which automates a few GitHub operations, like merging pull requests, notifying staff on Slack when a PR is opened, that kind of thing (it\'s a custom flav

2条回答
  •  一向
    一向 (楼主)
    2021-02-05 22:54

    My company uses Github enterprise.

    This API Docs link helped

    GET /repos/:owner/:repo/collaborators/:username

    If user has access you would get a response similar to

    Status: 204 No Content

    X-RateLimit-Limit: 5000

    X-RateLimit-Remaining: 4999

提交回复
热议问题