Skip to content

Commit

Permalink
chore: when merging always use the pull request title as commitHeadli…
Browse files Browse the repository at this point in the history
…ne (#34)
  • Loading branch information
Eun authored Oct 19, 2023
1 parent ed6a182 commit c506332
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions pkg/merge-with-label/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,21 @@ func MergePullRequest(
token,
pullRequestID,
expectedHeadOid,
mergeStrategy string,
mergeStrategy,
commitHeadline string,
) error {
_, err := doGraphQLRequest(ctx, client, token, `
mutation MergePulLRequest($pullRequestId: ID!, $expectedHeadOid: GitObjectID!, $mergeMethod: PullRequestMergeMethod!){
mutation MergePulLRequest(
$pullRequestId: ID!,
$expectedHeadOid: GitObjectID!,
$mergeMethod: PullRequestMergeMethod!,
$commitHeadline: String!
){
mergePullRequest(input: {
pullRequestId: $pullRequestId,
expectedHeadOid: $expectedHeadOid,
mergeMethod: $mergeMethod,
commitHeadline: $commitHeadline,
}) {
clientMutationId
}
Expand All @@ -308,6 +315,7 @@ mutation MergePulLRequest($pullRequestId: ID!, $expectedHeadOid: GitObjectID!, $
"pullRequestId": pullRequestID,
"expectedHeadOid": expectedHeadOid,
"mergeMethod": mergeStrategy,
"commitHeadline": commitHeadline,
})
if err != nil {
return errors.Wrap(err, "unable to merge pull request")
Expand Down
1 change: 1 addition & 0 deletions pkg/merge-with-label/worker/pull_request_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ func (worker *pullRequestWorker) mergePullRequest(
details.ID,
details.LastCommitSha,
cfg.Merge.Strategy.GithubString(),
details.Title,
); err != nil {
var graphQLErrors github.GraphQLErrors
if errors.As(err, &graphQLErrors) {
Expand Down

0 comments on commit c506332

Please sign in to comment.