Skip to content

Commit 5565092

Browse files
meorphismeorphis
andauthored
allow building a pull request if there are no conventional commits (#208)
Co-authored-by: meorphis <eric@stainless.com>
1 parent e9433c8 commit 5565092

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

src/manifest.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -835,14 +835,16 @@ export class Manifest {
835835
openPullRequests.find(pr => pr.headBranchName === branchName) ||
836836
snoozedPullRequests.find(pr => pr.headBranchName === branchName);
837837

838-
const releasePullRequest = await strategy.buildReleasePullRequest({
839-
commits: pathCommits,
840-
latestRelease,
841-
draft: config.draftPullRequest ?? this.draftPullRequest,
842-
labels: this.labels,
843-
existingPullRequest: existingPR,
844-
manifestPath: this.manifestPath,
845-
});
838+
const releasePullRequest = commitsPerPath[path]
839+
? await strategy.buildReleasePullRequest({
840+
commits: pathCommits,
841+
latestRelease,
842+
draft: config.draftPullRequest ?? this.draftPullRequest,
843+
labels: this.labels,
844+
existingPullRequest: existingPR,
845+
manifestPath: this.manifestPath,
846+
})
847+
: undefined;
846848
this.logger.debug(`path: ${path}`);
847849
this.logger.debug(
848850
`releasePullRequest.headRefName: ${releasePullRequest?.headRefName}`

src/strategies/base.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,7 @@ export abstract class BaseStrategy implements Strategy {
285285
manifestPath?: string;
286286
}): Promise<ReleasePullRequest | undefined> {
287287
const conventionalCommits = await this.postProcessCommits(commits);
288-
this.logger.info(`Considering: ${commits.length} commits`);
289-
if (commits.length === 0) {
290-
this.logger.info(`No commits for path: ${this.path}, skipping`);
291-
return undefined;
292-
}
288+
this.logger.info(`Considering: ${commits.length} conventional commits`);
293289

294290
const component = await this.getComponent();
295291
this.logger.debug('component:', component);

0 commit comments

Comments
 (0)