Add Allow Maintainer Edits #509

Merged
6543 merged 12 commits from 6543/tea:add_allow-maintainer-edits into main 2022-09-27 15:36:36 +00:00
2 changed files with 3 additions and 5 deletions
Showing only changes of commit c141bb650a - Show all commits

View File

@ -26,8 +26,7 @@ func PullDetails(pr *gitea.PullRequest, reviews []*gitea.PullReview, ciStatus *g
state := formatPRState(pr)
out := fmt.Sprintf(
// TODO: "# #%d %s (%s)\n@%s created %s\t**%s** <- **%s**\n\nAllow maintainer to edit: %v\n\n%s\n\n",
"# #%d %s (%s)\n@%s created %s\t**%s** <- **%s**\n\n%s\n\n",
"# #%d %s (%s)\n@%s created %s\t**%s** <- **%s**\n\nAllow maintainer to edit: %v\n\n%s\n\n",
pr.Index,
pr.Title,
state,
@ -35,7 +34,7 @@ func PullDetails(pr *gitea.PullRequest, reviews []*gitea.PullReview, ciStatus *g
FormatTime(*pr.Created, false),
base,
head,
// TODO: pr.AllowMaintainerEdit,
pr.AllowMaintainerEdit,
pr.Body,
6543 marked this conversation as resolved Outdated
Outdated
Review

just another sdk update ...

just another sdk update ...
)

View File

@ -70,8 +70,7 @@ func CreatePull(ctx *context.TeaContext, base, head string, allowMaintainerEdits
return fmt.Errorf("could not create PR from %s to %s:%s: %s", head, ctx.Owner, base, err)
}
// TODO: if pr.AllowMaintainerEdit != allowMaintainerEdits {
if allowMaintainerEdits {
if pr.AllowMaintainerEdit != allowMaintainerEdits {
pr, _, err = client.EditPullRequest(ctx.Owner, ctx.Repo, pr.Index, gitea.EditPullRequestOption{
6543 marked this conversation as resolved Outdated
Outdated
Review

pr.Index

pr.Index
AllowMaintainerEdit: gitea.OptionalBool(allowMaintainerEdits),
})