我正在尝试使用 github graphql api、使用createCommitOnBranch突变创建一个新的提交。ExpectedHeadOid 应该使用什么值:“??????”?如何从 Graphql API 获得这样的价值?
到目前为止,这是我的尝试:
{
mutation m1 {
createCommitOnBranch(
input: {
branch:
{repositoryNameWithOwner: "some_repo/some_owner",
branchName: "main"
},
message: {headline: "headline!"},
fileChanges: {
additions: {path: "README.md", contents: "SGVsbG8gV29ybGQ="}
}
expectedHeadOid: "?????"
}
)
}
}
Run Code Online (Sandbox Code Playgroud)