我有一个 GitHub 存储库,其中我使用 Protected Branches 的新功能保护了一个分支.
现在我的问题是我想在系统中执行状态检查,然后提交并推送到 GitHub 仓库。
问题:我在哪里执行此类状态检查以及如何将状态检查已清除的消息发送到 GitHub 服务器?
最佳答案
where do I perform such status checks
在同一个地方set up status checks : settings/branches (选择你的分支)
and how do I send the message to the GitHub server that the status checks have been cleared
当您从本地存储库推送到该分支时,这些检查会更新。
为了发送成功状态,您可以关注Building a CI server : 它将使用 Status API。
Status API负责将提交与测试服务捆绑在一起,以便您所做的每一次推送都可以在 GitHub pull 请求中进行测试和表示。
def process_pull_request(pull_request)
@client.create_status(pull_request['base']['repo']['full_name'], pull_request['head']['sha'], 'pending')
sleep 2 # do busy work...
@client.create_status(pull_request['base']['repo']['full_name'], pull_request['head']['sha'], 'success')
puts "Pull request processed!"
end
We're doing three very basic things here:
- we're looking up the full name of the repository
- we're looking up the last SHA of the pull request
- we're setting the status to "success"
关于git - 如何在 github 存储库中执行状态检查,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34946194/