From cf2bcee613a1d7eb5b350def5631b7054288b715 Mon Sep 17 00:00:00 2001 From: Andrea Brancaleoni Date: Tue, 18 Jun 2024 09:52:55 +0200 Subject: [PATCH] actions/*: simplify messages --- actions/add-mantainer-custom-property/action.cjs | 6 +++--- actions/check-new-repos/action.cjs | 2 +- actions/main/action.cjs | 2 +- actions/older-than-2y/action.cjs | 2 +- actions/renovate-sanity-check/action.cjs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/actions/add-mantainer-custom-property/action.cjs b/actions/add-mantainer-custom-property/action.cjs index fb807800..5991f77e 100644 --- a/actions/add-mantainer-custom-property/action.cjs +++ b/actions/add-mantainer-custom-property/action.cjs @@ -2,17 +2,17 @@ module.exports = async ({ github, context, inputs, actionPath, core, debug = fal const { default: addMaintainerCustomProperty } = await import(`${actionPath}/src/addMaintainerCustomProperty.js`) const { default: sendSlackMessage } = await import(`${actionPath}/src/sendSlackMessage.js`) - const reposWithoutMaintainer = await addMaintainerCustomProperty({ + const message = await addMaintainerCustomProperty({ org: context.repo.owner, github, ignoreMaintainers: inputs.ignore_maintainers, debug }) - if (reposWithoutMaintainer.trim().length > 0) { + if (message.trim().length > 0) { await sendSlackMessage({ token: inputs.slack_token, - message: `[add-maintainer-custom-property] ${reposWithoutMaintainer}`, + message, channel: '#secops-hotspots', color: 'yellow', username: 'add-maintainer-custom-property' diff --git a/actions/check-new-repos/action.cjs b/actions/check-new-repos/action.cjs index c6c47538..14c08c75 100644 --- a/actions/check-new-repos/action.cjs +++ b/actions/check-new-repos/action.cjs @@ -39,7 +39,7 @@ module.exports = async ({ github, context, inputs, actionPath, core, debug = fal if (message.trim().length > 0) { await sendSlackMessage({ token: inputs.slack_token, - message: `[check-new-repos] ${message}`, + message, channel: '#secops-hotspots', color: 'yellow', username: 'check-new-repos' diff --git a/actions/main/action.cjs b/actions/main/action.cjs index 6d5aaee8..ddc8b2e5 100644 --- a/actions/main/action.cjs +++ b/actions/main/action.cjs @@ -259,7 +259,7 @@ module.exports = async ({ github, context, inputs, actionPath, core, debug = fal // Send slack message, if there are any findings await sendSlackMessage({ token: options.slack_token, - text: `[security-action] ${actor} pushed commits. /cc ${slackAssignees}`, + text: `${actor} pushed commits. /cc ${slackAssignees}`, message, channel: '#secops-hotspots', color: 'green', diff --git a/actions/older-than-2y/action.cjs b/actions/older-than-2y/action.cjs index 6cbc7dc7..f9b32c54 100644 --- a/actions/older-than-2y/action.cjs +++ b/actions/older-than-2y/action.cjs @@ -38,5 +38,5 @@ module.exports = async ({ github, context, inputs, actionPath, core, debug = fal core.setSecret(message) - if (message.length > 0) { await sendSlackMessage({ debug, username: 'older-than-2y', message: `[older-than-2y] ${message}`, color: 'blue', channel: '#security-hotspots', token: inputs.slack_token }) } + if (message.length > 0) { await sendSlackMessage({ debug, username: 'older-than-2y', message, color: 'blue', channel: '#security-hotspots', token: inputs.slack_token }) } } diff --git a/actions/renovate-sanity-check/action.cjs b/actions/renovate-sanity-check/action.cjs index 438f81b3..18a84322 100644 --- a/actions/renovate-sanity-check/action.cjs +++ b/actions/renovate-sanity-check/action.cjs @@ -9,5 +9,5 @@ module.exports = async ({ github, context, inputs, actionPath, core, debug = fal debug }) - if (message.length > 0) { await sendSlackMessage({ debug, username: 'renovate-sanity-check', message: `[renovate-sanity-check] ${message}`, color: 'yellow', channel: '#security-action', token: inputs.slack_token }) } + if (message.length > 0) { await sendSlackMessage({ debug, username: 'renovate-sanity-check', message, color: 'yellow', channel: '#security-action', token: inputs.slack_token }) } }