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

fix: pass pull request header and footer options to merge plugin #2143

Merged
merged 5 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
} from './factory';
import {Release} from './release';
import {Strategy} from './strategy';
import {Merge} from './plugins/merge';
import {MergeOptions, Merge} from './plugins/merge';
import {ReleasePleaseManifest} from './updaters/release-please-manifest';
import {
DuplicateReleaseError,
Expand Down Expand Up @@ -749,10 +749,33 @@ export class Manifest {
// Combine pull requests into 1 unless configured for separate
// pull requests
if (!this.separatePullRequests) {
const mergeOptions: MergeOptions = {
pullRequestTitlePattern: this.groupPullRequestTitlePattern,
};
// Find the first repositoryConfig item that has a set value
// for the options that can be passed to the merge plugin
for (const path in this.repositoryConfig) {
const config = this.repositoryConfig[path];
if (
'pullRequestHeader' in config &&
!('pullRequestHeader' in mergeOptions)
) {
mergeOptions.pullRequestHeader = config.pullRequestHeader;
}
if (
'pullRequestFooter' in config &&
!('pullRequestFooter' in mergeOptions)
) {
mergeOptions.pullRequestFooter = config.pullRequestFooter;
}
}
this.plugins.push(
new Merge(this.github, this.targetBranch, this.repositoryConfig, {
pullRequestTitlePattern: this.groupPullRequestTitlePattern,
})
new Merge(
this.github,
this.targetBranch,
this.repositoryConfig,
mergeOptions
)
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/plugins/merge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import {Update} from '../update';
import {mergeUpdates} from '../updaters/composite';
import {GitHub} from '../github';

interface MergeOptions {
export interface MergeOptions {
pullRequestTitlePattern?: string;
pullRequestHeader?: string;
pullRequestFooter?: string;
Expand Down