Skip to content

Commit

Permalink
action.cjs: run in drafts, but don't add labels/assignees/slack notif…
Browse files Browse the repository at this point in the history
…ication
  • Loading branch information
thypon committed Jun 5, 2024
1 parent 00f6ca9 commit 7dfce5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions action.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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}`)
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7dfce5f

Please sign in to comment.