Skip to content

Commit

Permalink
fix: pass pull request title pattern when parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
dgellow committed Sep 15, 2023
1 parent 3d303b2 commit d6726fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1380,7 +1380,12 @@ export class Manifest {

// updating git branches isn't always instant and can take a bit of time to propagate throughout github systems,
// it is safer to wait a little bit before doing anything else
const version = PullRequestTitle.parse(pr.title)?.getVersion();
const version = PullRequestTitle.parse(
pr.title,
this.repositoryConfig[branchName.getComponent() || '.']
?.pullRequestTitlePattern,
this.logger
)?.getVersion();
if (!version) {
this.logger.warn(
`PR #${pr.number} title missing a version number: '${pr.title}'`
Expand Down
4 changes: 3 additions & 1 deletion src/strategies/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ export abstract class BaseStrategy implements Strategy {
`PR already exists for ${existingPullRequest.headBranchName}, checking if PR title edited to set custom version`
);
const existingPRTitleVersion = PullRequestTitle.parse(
existingPullRequest.title
existingPullRequest.title,
this.pullRequestTitlePattern,
this.logger
)?.getVersion();
const hasCustomVersionLabel = existingPullRequest.labels.find(
label => label === DEFAULT_CUSTOM_VERSION_LABEL
Expand Down

0 comments on commit d6726fb

Please sign in to comment.