From cf9c7baf6e6ba9adb4feff3767aa5eddb6693eca Mon Sep 17 00:00:00 2001 From: Rongrong Date: Mon, 28 Nov 2022 02:12:29 +0800 Subject: [PATCH] ci(test-route): fix regex (#11335) Signed-off-by: Rongrong Signed-off-by: Rongrong --- scripts/workflow/test-route/identify.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/workflow/test-route/identify.js b/scripts/workflow/test-route/identify.js index 70a51515ad..928d113ad0 100644 --- a/scripts/workflow/test-route/identify.js +++ b/scripts/workflow/test-route/identify.js @@ -4,7 +4,7 @@ const whiteListedUser = ['dependabot[bot]', 'pull[bot]']; // dependabot and down module.exports = async ({ github, context, core }, body, number, sender) => { core.debug(`sender: ${sender}`); core.debug(`body: ${body}`); - const m = body.match(/```routes(?:\n|\r\n)((.|\n|\r\n)*)```/); + const m = body.match(/```routes\s+([\s\S]*?)```/); core.debug(`match: ${m}`); let res = null; @@ -39,7 +39,7 @@ module.exports = async ({ github, context, core }, body, number, sender) => { } if (m && m[1]) { - res = m[1].trim().split('\r\n'); + res = m[1].trim().split(/\r?\n/); core.info(`routes detected: ${res}`); if (res.length > 0 && res[0] === 'NOROUTE') {