CircleCI-Public / slack-orb

Create custom Slack notifications for CircleCI job statuses
https://circleci.com/developer/orbs/orb/circleci/slack
MIT License
214 stars 205 forks source link

Should throw error on missing SLACK_ACCESS_TOKEN #185

Closed BeyondEvil closed 3 years ago

BeyondEvil commented 4 years ago

Orb version:

4.0.0

What happened:

Notify job passes but no notification is sent.

Expected behavior:

Notification sent successfully.

Additional Information:

I had forgotten to set the SLACK_ACCESS_TOKEN environment variable. Was quite surprised when I realized that the issue was the missing env var and no error had been produced.

KyleTryon commented 4 years ago

Thank you for sharing this. We will include this in the next patch asap.

addb commented 3 years ago

@KyleTryon I have a SLACK_WEBHOOK and SLACK_DEFAULT_CHANNEL configured, but I don't see any slack notification and the error response is

{
  "ok": false,
  "error": "not_authed"
}

and build passes as mentioned in the issue. In the steps that i followed Its just adding Webhook and adding slack orbs in the config file. What am I missing here?

KyleTryon commented 3 years ago

@KyleTryon I have a SLACK_WEBHOOK and SLACK_DEFAULT_CHANNEL configured, but I don't see any slack notification and the error response is

{
  "ok": false,
  "error": "not_authed"
}

and build passes as mentioned in the issue. In the steps that i followed Its just adding Webhook and adding slack orbs in the config file. What am I missing here?

Hello, sorry for the confusion, we are updating the in-app instructions. The setup for Slack orb v4 does not use webhooks, it instead uses OAuth.

More information can be found here. https://github.com/CircleCI-Public/slack-orb/wiki/Setup

addb commented 3 years ago

@KyleTryon I have a SLACK_WEBHOOK and SLACK_DEFAULT_CHANNEL configured, but I don't see any slack notification and the error response is

{
  "ok": false,
  "error": "not_authed"
}

and build passes as mentioned in the issue. In the steps that i followed Its just adding Webhook and adding slack orbs in the config file. What am I missing here?

Hello, sorry for the confusion, we are updating the in-app instructions. The setup for Slack orb v4 does not use webhooks, it instead uses OAuth.

More information can be found here. https://github.com/CircleCI-Public/slack-orb/wiki/Setup Thanks @KyleTryon. Just to add, at the end of those steps, I had to manually add the app (/invite app_name) into the Slack channel. I think it is better to mention this in the setup doc.