From 2d0b30636e52913ef165e81caaf718f9038bbefa Mon Sep 17 00:00:00 2001 From: Sylvain Niles Date: Thu, 4 Jan 2024 11:02:51 -0800 Subject: [PATCH] remove brackets Signed-off-by: Sylvain Niles --- .github/actions/check-pr-format/action.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/actions/check-pr-format/action.yml b/.github/actions/check-pr-format/action.yml index 7aae8da56f..0307079637 100644 --- a/.github/actions/check-pr-format/action.yml +++ b/.github/actions/check-pr-format/action.yml @@ -13,8 +13,7 @@ jobs: - name: Check PR title run: | const title = context.payload.pull_request.title; - const regex = /\[(Add|Remove|Update|Fix)\]\s*.+/; - const regexNoBrackets = /(Add|Remove|Update|Fix)\s*.+/i; + const regex = /(Add|Remove|Update|Fix)\s*.+/; const regexNoSpace = /\[(Add|Remove|Update|Fix)\].+/i; const regexLowerCase = /\[(add|remove|update|fix)\]\s*.+/i; const issue_number = context.payload.pull_request.number; @@ -23,14 +22,12 @@ jobs: let body = ''; if (!regex.test(title)) { - if (regexNoBrackets.test(title)) { - body = 'Your PR title is missing square brackets. Please update it to: [Add | Remove | Update | Fix] . For example: [Add] New feature'; - } else if (regexNoSpace.test(title)) { - body = 'Your PR title is missing a space after the keyword. Please update it to: [Add | Remove | Update | Fix] <Title>. For example: [Remove] Old feature'; + if (regexNoSpace.test(title)) { + body = 'Your PR title is missing a space after the keyword. Please update it to: [Add | Remove | Update | Fix] <Title>. For example: Remove Old feature'; } else if (regexLowerCase.test(title)) { - body = 'The keyword in your PR title is not capitalized. Please update it to: [Add | Remove | Update | Fix] <Title>. For example: [Update] Existing feature'; + body = 'The keyword in your PR title is not capitalized. Please update it to: [Add | Remove | Update | Fix] <Title>. For example: Update Existing feature'; } else { - body = 'Your PR does not have a [Add | Remove | Update | Fix] <Title>. Please add one to help streamline our changelog. For example: [Fix] Bug in feature'; + body = 'Your PR does not have a [Add | Remove | Update | Fix] <Title>. Please add one to help streamline our changelog. For example: Fix Bug in feature'; } github.issues.createComment({ issue_number, owner, repo, body }); }