-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: implement custom automergeMergeCommitMessage #36205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: implement custom automergeMergeCommitMessage #36205
Conversation
…nch-merge-strategies
@@ -284,6 +284,25 @@ Example use: | |||
} | |||
``` | |||
|
|||
## automergeMergeCommitMessage | |||
|
|||
Use this only if you configure `automergeType="branch"` and `automergeStrategy` is `merge-commit` or `squash`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why wouldn't we just use the PR title for the message for squash?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this applies to squash too then we need to rethink the config option name above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why wouldn't we just use the PR title for the message for squash?
Does the PR title indicate if the pull request was automerged or not? If so, we could reuse it.
If this applies to squash too then we need to rethink the config option name above
Yes, it will be used for squash commits in the current setup. I don't have a strong opinion on this, but do you think changing the option name would be a good idea? My first suggestion was automergeCommitMessage
.
if (commitMessage) { | ||
await gitRetry(() => git.commit(commitMessage)); | ||
} else { | ||
// Use the default commit message for the squash commit from git | ||
await gitRetry(() => git.raw(['commit', '--no-edit'])); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use the PR title for this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @rarkins
I just digged through the code and also tested in on a real world example, but the PR title doesn't contain the information if the pull request was automerged or not. In our setup, I looks like this: Update dependency my-dependency-name to v4.24.1-1
. The goal of my PR is to add an option to define a custom commit message if the PR was automerged.
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Changes
Context
Hi, we're encountering an issue in our build pipelines where distinguishing between automatically merged pull requests and those merged manually is challenging, as this information is only present in the pull request description, not in the git repository or commits themselves. To address this, I added an option
automergeMergeCommitMessage
which can be used to overwrite the default merge commit message generated by git, but only ifautomergeType=branch
.NOTE: This PR contains all the commits from my previous PR which it depends on!
See: #35884
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: