From f3b8f29a8e02e94d4e52ced30eedf200e5726075 Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Wed, 5 Jun 2024 11:35:17 +0200 Subject: [PATCH] action.cjs: run in drafts, but don't add labels/assignees/slack notification --- action.cjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/action.cjs b/action.cjs index ca49c1f8..0ce2f644 100644 --- a/action.cjs +++ b/action.cjs @@ -80,8 +80,8 @@ module.exports = async ({ github, context, inputs, actionPath, core, debug = fal debugLog('Security Action enabled') // reviewdog-enabled-pr steps - const reviewdogEnabledPr = options.baseline_scan_only && process.env.GITHUB_EVENT_NAME === 'pull_request' && context.payload.pull_request.draft === false && context.actor !== 'dependabot[bot]' - debugLog(`Security Action enabled for PR: ${reviewdogEnabledPr}, baseline_scan_only: ${options.baseline_scan_only}, GITHUB_EVENT_NAME: ${process.env.GITHUB_EVENT_NAME}, context.actor: ${context.actor}, context.payload.pull_request.draft: ${context.payload.pull_request?.draft}`) + const reviewdogEnabledPr = options.baseline_scan_only && process.env.GITHUB_EVENT_NAME === 'pull_request' && context.actor !== 'dependabot[bot]' + debugLog(`Security Action enabled for PR: ${reviewdogEnabledPr}, baseline_scan_only: ${options.baseline_scan_only}, GITHUB_EVENT_NAME: ${process.env.GITHUB_EVENT_NAME}, context.actor: ${context.actor}`) // reviewdog-enabled-full steps const reviewdogEnabledFull = !reviewdogEnabledPr && (!options.baseline_scan_only || process.env.GITHUB_EVENT_NAME === 'workflow_dispatch') debugLog(`Security Action enabled for full: ${reviewdogEnabledFull}, baseline_scan_only: ${options.baseline_scan_only}, GITHUB_EVENT_NAME: ${process.env.GITHUB_EVENT_NAME}`) @@ -179,7 +179,7 @@ module.exports = async ({ github, context, inputs, actionPath, core, debug = fal debugLog('Description contains hotwords:', descriptionContainsHotwords) // add should-trigger label step - const shouldTrigger = reviewdogEnabledPr && !assigneeRemovedLabel && ((commentsBefore < commentsAfter) || descriptionContainsHotwords) + const shouldTrigger = reviewdogEnabledPr && context.payload.pull_request.draft === false && !assigneeRemovedLabel && ((commentsBefore < commentsAfter) || descriptionContainsHotwords) debugLog('Should trigger:', shouldTrigger) if (shouldTrigger) {