Skip to content

Commit d536992

Browse files
committed
Parse id from branch and accept lower case in project name
1 parent 4e6a123 commit d536992

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/helpers/github.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ export async function getPullRequestIssueIds(pr: PullRequestType): Promise<strin
6161
extractIssueNumbers(pr.title).map((id) => ids.add(id));
6262
}
6363

64+
if (typeof pr.head?.ref === 'string') {
65+
extractIssueNumbers(pr.head.ref).map((id) => ids.add(id));
66+
}
67+
6468
return [...ids];
6569
}
6670

src/helpers/issue.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
const ISSUE_PATTERN_RE = /(?<![a-zA-Z0-9])[A-Z][A-Z0-9]{1,}-\d+(?![a-zA-Z0-9])/g;
1+
const ISSUE_PATTERN_RE = /(?<![a-zA-Z0-9])[A-Z][A-Z0-9]{1,}-\d+(?![a-zA-Z0-9])/gi;
22

33
export function extractIssueNumbers(string: string): string[] {
44
const result: Set<string> = new Set();
5-
string.match(ISSUE_PATTERN_RE)?.forEach((issue) => result.add(issue));
5+
string.match(ISSUE_PATTERN_RE)?.forEach((issue) => result.add(issue.toUpperCase()));
66
return [...result];
77
}

0 commit comments

Comments
 (0)