如何在 github 存储库中执行状态检查
How to perform status checks in github repository
我有一个 GitHub 存储库,其中我使用 Protected Branches 的新功能保护了一个分支。
现在我的问题是我希望在系统中执行状态检查,然后提交并将其推送到 GitHub 存储库。
问题:在哪里执行此类状态检查以及如何将状态检查已清除的消息发送到 GitHub 服务器?
where do I perform such status checks
在你所在的同一个地方set up status checks:settings/branches(select你的分支)
and how do I send the message to the GitHub server that the status checks have been cleared
当您从本地存储库推送到该分支时,这些检查会更新。
为了发送成功状态,您可以按照Building a CI server:它将使用状态API。
Status API 负责将提交与测试服务捆绑在一起,这样您所做的每一次推送都可以在 GitHub 拉取请求中进行测试和表示。
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"
我有一个 GitHub 存储库,其中我使用 Protected Branches 的新功能保护了一个分支。
现在我的问题是我希望在系统中执行状态检查,然后提交并将其推送到 GitHub 存储库。
问题:在哪里执行此类状态检查以及如何将状态检查已清除的消息发送到 GitHub 服务器?
where do I perform such status checks
在你所在的同一个地方set up status checks:settings/branches(select你的分支)
and how do I send the message to the GitHub server that the status checks have been cleared
当您从本地存储库推送到该分支时,这些检查会更新。
为了发送成功状态,您可以按照Building a CI server:它将使用状态API。
Status API 负责将提交与测试服务捆绑在一起,这样您所做的每一次推送都可以在 GitHub 拉取请求中进行测试和表示。
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"