git - 如何在 github 存储库中执行状态检查

标签 git github version-control repository status

我有一个 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/

相关文章:

c - 为什么 sourceTree 会自动推送具有本地更改的文件?

version-control - Mercurial 工作流 - 我什么时候可以 rebase ,什么时候应该 merge ?

git - 获取任意 git 工作副本并制作与远程分支完全相同的副本

linux - 在 Debian 服务器上通过 ssh 连接到 Git 用户时没有(自定义)答案

xcode - 被 Git/Xcode 和 GitHub for Mac 难住了

github - 更改index.html后,GitHub页面需要多长时间才能显示更改

git - 从 Github Angular 4 项目中排除环境文件

version-control - Mercurial和Notepad++集成

java - 使用 JGit 获取更改文件列表

bash - 将整个提交复制到单独的目录中