Skip to content

Commit a04c124

Browse files
committed
Fix issue with backticks, and whitespace
1 parent e1a52d4 commit a04c124

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

scripts/validate-release.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export async function main(): Promise<void> {
183183
switch (releaseValidationResult.status) {
184184
case ReleaseValidationStatus.InvalidRelease:
185185
commentMessage = `${greeting}
186-
186+
187187
It looks like you're trying to make a release PR, but some things don't look right:
188188
189189
${releaseValidationResult.errorMessages.map((msg) => `- ${msg}`).join('\n')}
@@ -422,7 +422,14 @@ function validateReleaseTitle({
422422
return {
423423
isSuccess: false,
424424
message: `The ${source} "${possibleReleaseTitle}" does not match a valid release title format`,
425-
errorMessage: `Your ${source} must match one of the following formats: ${niceValidReleaseTitlePatterns.map((pattern) => `"${pattern.replace(/`/gu, '\\`')}"`).join(', ')}`,
425+
errorMessage: `Your ${source} must match one of the following formats: ${niceValidReleaseTitlePatterns
426+
.map((pattern) => {
427+
if (pattern.includes('`')) {
428+
return `\`\` ${pattern} \`\``;
429+
}
430+
return `\`${pattern}\``;
431+
})
432+
.join(', ')}`,
426433
};
427434
}
428435

0 commit comments

Comments
 (0)