diff --git a/.github/actions/semantic-pr-footer-v1/dist/index.js b/.github/actions/semantic-pr-footer-v1/dist/index.js index fe16fdd..97791a9 100644 --- a/.github/actions/semantic-pr-footer-v1/dist/index.js +++ b/.github/actions/semantic-pr-footer-v1/dist/index.js @@ -29251,9 +29251,9 @@ const validFooterPrefixes = [ ]; const validFooters = ['no qa needed', 'no qa required']; const validFooterPrefixRegex = new RegExp(`^(${validFooterPrefixes.join('|')}):? `, 'i'); +const validFooterRegex = new RegExp(`^(${validFooters.join('|')})`, 'i'); function isValidFooter(footer) { - footer = footer.toLowerCase(); - return validFooters.includes(footer) || validFooterPrefixRegex.test(footer); + return validFooterRegex.test(footer) || validFooterPrefixRegex.test(footer); } diff --git a/.github/actions/semantic-pr-footer-v1/src/isValidFooter.test.ts b/.github/actions/semantic-pr-footer-v1/src/isValidFooter.test.ts index 8904177..1a8176d 100644 --- a/.github/actions/semantic-pr-footer-v1/src/isValidFooter.test.ts +++ b/.github/actions/semantic-pr-footer-v1/src/isValidFooter.test.ts @@ -28,7 +28,9 @@ describe('isValidFooter', () => { 'QA Notes ', 'QA Notes: ', 'No QA required', - 'No QA needed' + 'No QA needed', + 'No QA required (test only)', + 'No QA needed: validate as part of separate ticket' ] for (const validCase of validCases) { diff --git a/.github/actions/semantic-pr-footer-v1/src/isValidFooter.ts b/.github/actions/semantic-pr-footer-v1/src/isValidFooter.ts index 13ee41d..0d188c3 100644 --- a/.github/actions/semantic-pr-footer-v1/src/isValidFooter.ts +++ b/.github/actions/semantic-pr-footer-v1/src/isValidFooter.ts @@ -1,3 +1,4 @@ +// These must appear with a suffix (eg, "fix #123" or "QA Notes: test X, Y, and Z") const validFooterPrefixes = [ // Should accept all github terms that link an issue // @see https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword @@ -15,14 +16,15 @@ const validFooterPrefixes = [ 'refs', 'qa notes' ] + +// These may appear alone or with a suffix (eg, "no qa needed" or "no qa needed (test only)") const validFooters = ['no qa needed', 'no qa required'] const validFooterPrefixRegex = new RegExp( `^(${validFooterPrefixes.join('|')}):? `, 'i' ) +const validFooterRegex = new RegExp(`^(${validFooters.join('|')})`, 'i') export default function isValidFooter(footer: string): boolean { - footer = footer.toLowerCase() - - return validFooters.includes(footer) || validFooterPrefixRegex.test(footer) + return validFooterRegex.test(footer) || validFooterPrefixRegex.test(footer) }