Skip to content

Commit

Permalink
actions/*: simplify messages
Browse files Browse the repository at this point in the history
  • Loading branch information
thypon committed Jun 20, 2024
1 parent b259b75 commit cf2bcee
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions actions/add-mantainer-custom-property/action.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion actions/check-new-repos/action.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion actions/main/action.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion actions/older-than-2y/action.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) }
}
2 changes: 1 addition & 1 deletion actions/renovate-sanity-check/action.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }) }
}

0 comments on commit cf2bcee

Please sign in to comment.