GitHub API : 创建已经存在的拉取请求不应抛出异常

GitHub API : create pull-request that already exists should not throw exception

GitHub API

尝试在已存在拉取请求的分支上创建拉取请求将抛出 422 Unprocessable Entity

是否可以指示 GitHub API 代替 return 成功代码?

Is it possible to instruct GitHub API to instead return success code ?

GitHubAPI本身,没有
但是您的脚本可以在创建 PR 时出现 422 错误,然后检查 PR 是否已经存在,如果存在,return 从该 PR 创建函数中获取成功代码。

作为 OP BaltoStar :

more simply just check the response error message and if matches text for PR already exists then return success code.