Skip to content
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

Add 'pull-request-title-and-commit-details' option for MERGE_COMMIT_MESSAGE #254

Open
hwhsu1231 opened this issue Feb 19, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@hwhsu1231
Copy link

hwhsu1231 commented Feb 19, 2024

Feature Request

Hello, author of automerge-action.

According to README.md, the current possible values of MERGE_COMMIT_MESSAGE are:

  • automatic (default)
  • pull-request-title
  • pull-request-description
  • pull-request-title-and-description
  • a literal value with optional placeholders

I wonder whether it is possible to add a new option, pull-request-title-and-commit-details?

Corresponding to the option in Allow squash merging:

image

Versions

Current latest release: v0.16.2

@hwhsu1231
Copy link
Author

Related to this part?

function getCommitMessage(mergeCommitMessage, pullRequest) {
if (mergeCommitMessage === "automatic") {
return undefined;
} else if (mergeCommitMessage === "pull-request-title") {
return pullRequest.title;
} else if (mergeCommitMessage === "pull-request-description") {
return pullRequest.body;
} else if (mergeCommitMessage === "pull-request-title-and-description") {
return (
pullRequest.title + (pullRequest.body ? "\n\n" + pullRequest.body : "")
);
} else {
return mergeCommitMessage.replace(PR_PROPERTY, (_, prProp) =>
resolvePath(pullRequest, prProp)
);
}
}

@hwhsu1231
Copy link
Author

Hello, @pascalgn

Is there a placeholder to reference all the commits details of a Pull Request, such as pullRequest.commitDetails?

If so, then I think I could customize the "pull-request-title-and-commit-details" with PR number appended. For example:

{pullRequest.title} (#{pullRequest.number})

{pullRequest.commitDetails}

@hwhsu1231 hwhsu1231 changed the title Set MERGE_COMMIT_MESSAGE to 'pull-request-title-and-commit-details'? Add 'pull-request-title-and-commit-details' option for MERGE_COMMIT_MESSAGE Feb 27, 2024
@pascalgn pascalgn added the enhancement New feature or request label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants