Skip to content

Commit

Permalink
Manual merge notice
Browse files Browse the repository at this point in the history
spr PRs are almost never meant to be merged via the GitHub UI.
Add a notice to every PR explaining not to merge manually.

Exclude unstacked PRs.

commit-id:2d753c44
  • Loading branch information
leoluk committed Dec 18, 2021
1 parent 16373aa commit 3f2bf32
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion github/githubclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,13 @@ func formatBody(commit git.Commit, stack []*github.PullRequest) string {

return fmt.Sprintf("**Stack**:\n%s\n\n%s",
formatStackMarkdown(commit, stack),
wrapInMarkdown(commit.Body))
addManualMergeNotice(wrapInMarkdown(commit.Body)))
}

func addManualMergeNotice(body string) string {
return body + "\n\n" +
"⚠️ *Part of a stack created by [spr](https://github.com/ejoffe/spr). " +
"Do not merge manually using the UI - doing so may have unexpected results.*"
}

func (c *client) UpdatePullRequest(ctx context.Context,
Expand Down

0 comments on commit 3f2bf32

Please sign in to comment.