我们如何知道使用github中的API批准或拒绝请求请求?
问题描述:
我想知道Github API中是否有一个函数可以返回请求请求的状态,无论请求是被接受还是被拒绝.这样的功能存在吗?
I would like to know if there is an function in the Github API which would return the status of a pull request whether its accepted or rejected. Does such a function exist?
答
您可以获得一个PR 并检查其state
和merged
属性.如果已合并,则表示接受.如果关闭但未合并,则可能会拒绝.
You can get a single PR and check it's state
and merged
properties. If it's merged, then it's accepted. If it's closed and not merged it may be rejected.
实际上,它可能不会被拒绝,而是被创建者关闭.我不确定是否可以检查它是否已被其他用户(拒绝)或其创建者(拒绝)关闭.
In fact it may be not rejected but closed by a creator. I'm not sure if it's possible to check if it was closed by another user (rejected) or by it's creator (denied).