stop set-milestone from exploding on first CI run on new release branch (#82576)

This commit is contained in:
Chris Vandoodewaard
2026-09-17 08:33:54 -04:00
committed by GitHub
parent c881cfaa4e
commit 9daae78940

View File

@@ -1,4 +1,5 @@
export function getLinkedIssues(body: string) { export function getLinkedIssues(body: string) {
if (!body) return null;
const matches = body.match( const matches = body.match(
/(close(s|d)?|fixe?(s|d)?|resolve(s|d)?)(:?) (#|https?:\/\/github\.com\/.+metabase\/issues\/)(\d+)/gi, /(close(s|d)?|fixe?(s|d)?|resolve(s|d)?)(:?) (#|https?:\/\/github\.com\/.+metabase\/issues\/)(\d+)/gi,
); );
@@ -16,6 +17,7 @@ export function getLinkedIssues(body: string) {
export const issueNumberRegex = /\(#(\d+)\)/g export const issueNumberRegex = /\(#(\d+)\)/g
export function getPRsFromCommitMessage(message: string) { export function getPRsFromCommitMessage(message: string) {
if (!message) return null;
const firstLine = message.split('\n\n')[0]; const firstLine = message.split('\n\n')[0];
const result = [ ...firstLine.matchAll(issueNumberRegex) ]; const result = [ ...firstLine.matchAll(issueNumberRegex) ];
if (!result.length) { if (!result.length) {
@@ -28,6 +30,7 @@ export function getPRsFromCommitMessage(message: string) {
// backport PRs just have a pr number in the body without a keyword // backport PRs just have a pr number in the body without a keyword
export function getBackportSourcePRNumber(body: string) { export function getBackportSourcePRNumber(body: string) {
if (!body) return null;
const matches = body.match(/#(\d+)/); const matches = body.match(/#(\d+)/);
return matches ? Number(matches[1]) : null; return matches ? Number(matches[1]) : null;
} }