Skip to content

Commit

Permalink
chore: Don't crash on missing env: log and quit early
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Mar 19, 2021
1 parent ca53d0c commit 2640acd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ async function run(): Promise<void> {
try {
const url = process.env.SLACK_WEBHOOK_URL
if (!url) {
throw new Error('Missing SLACK_WEBHOOK_URL environment variable')
core.info(
'No SLACK_WEBHOOK_URL environment variable provided, skipping sending Slack notification.'
)
return
}
const webhook = new IncomingWebhook(url)
const status = core.getInput('status') as
Expand Down

0 comments on commit 2640acd

Please sign in to comment.