Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/wizard/github.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ function create_or_update_pull_request(repo, params; auth=github_auth())
"base" => params["base"],
"head" => string(split(repo, "/")[1], ":", params["head"]),
))
# It's undocumented, but `maintainer_can_modify=true` appears to be always
# invalid in update PR requests, causing the error
# Fork collab can only be enabled on cross-repo pull requests
params["maintainer_can_modify"] = false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not documented but my read here is that true is valid only on cross-repo PRs. If this code is always used for same-repo PRs (within General) then this seems correct.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though I would err on the side of passing this in

"maintainer_can_modify" => true,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Official advice from github is actually to omit maintainer_can_modify entirely from same-repo PRs

return update_pull_request(repo, first(prs).number; auth=auth, params=params)
else
rethrow(ex)
Expand Down
Loading