Skip to content

Commit

Permalink
defect: fail on empty webhook url
Browse files Browse the repository at this point in the history
  • Loading branch information
titenkov committed Nov 27, 2023
1 parent 560ef98 commit 195b8b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@ try {
? `>${commitMessage}\n>${links.commit} | By *${sender.name}* on \`${env.branch}\` | ${links.repository}`
: `>By *${sender.name}* on \`${env.branch}\` | ${links.repository}`

if (!process.env.SLACK_WEBHOOK_URL) {
core.setFailed('Missing SLACK_WEBHOOK_URL environment variable')
return
}

const webhook = new IncomingWebhook(process.env.SLACK_WEBHOOK_URL)
const message = {
blocks: [
Expand Down

0 comments on commit 195b8b4

Please sign in to comment.