Skip to content

Commit 11c56f1

Browse files
authored
Remove "state": "OPEN" to fix updating of titles (#931)
1 parent 2d8e96a commit 11c56f1

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

pkg/plugins/scms/github/pullrequest.go

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,15 @@ func (p *PullRequest) CreatePullRequest(title, changelog, pipelineReport string)
169169
return err
170170
}
171171

172-
// No pullrequest ID so we first have to create the remote pullrequest
172+
// No pull request ID, so we first have to create the remote pull request
173173
if len(p.remotePullRequest.ID) == 0 {
174174
err = p.OpenPullRequest()
175175
if err != nil {
176176
return err
177177
}
178178
}
179179

180-
// Once the remote pull request exist, we can than update it with additional information such as
180+
// Once the remote pull request exists, we can than update it with additional information such as
181181
// tags,assignee,etc.
182182

183183
err = p.updatePullRequest()
@@ -245,7 +245,7 @@ func (p *PullRequest) updatePullRequest() error {
245245
{
246246
"input": {
247247
"title":"xxx",
248-
"pullRequestId" : "yyy
248+
"pullRequestId" : "yyy"
249249
}
250250
}
251251
*/
@@ -289,14 +289,11 @@ func (p *PullRequest) updatePullRequest() error {
289289
labelsID = append(labelsID, githubv4.NewID(label.ID))
290290
}
291291

292-
pullRequestUpdateStateOpen := githubv4.PullRequestUpdateStateOpen
293-
294292
input := githubv4.UpdatePullRequestInput{
295293
PullRequestID: githubv4.String(p.remotePullRequest.ID),
296294
Title: githubv4.NewString(githubv4.String(title)),
297295
Body: githubv4.NewString(githubv4.String(bodyPR)),
298296
LabelIDs: &labelsID,
299-
State: &pullRequestUpdateStateOpen,
300297
}
301298

302299
err = p.gh.client.Mutate(context.Background(), &mutation, input, nil)
@@ -352,7 +349,7 @@ func (p *PullRequest) EnablePullRequestAutoMerge() error {
352349
return nil
353350
}
354351

355-
// OpenPullRequest creates a new pull request on Github.
352+
// OpenPullRequest creates a new pull request on GitHub.
356353
func (p *PullRequest) OpenPullRequest() error {
357354

358355
/*

0 commit comments

Comments
 (0)