Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/adityachandak287/netlify-slack-webhook

Get around Netlify and Slack premium integrations by getting netlify build notifications sent to your slack channels using webhooks.
https://github.com/adityachandak287/netlify-slack-webhook

lambda netlify serverless slack webhooks

Last synced: about 5 hours ago
JSON representation

Get around Netlify and Slack premium integrations by getting netlify build notifications sent to your slack channels using webhooks.

Awesome Lists containing this project

README

        

# Netlify Slack Webhook
Serverless badge Serverless badge AWS Lambda badge Netlify badge Slack badge

Get around Netlify and Slack premium integrations by getting netlify build notifications sent to your slack channels using webhooks.

## `What is this?`

This project helps you get build notifications from netlify into your slack channel. The architecure looks something like this:

## `Instructions`

Want to use this project? Follow these steps:

### `Step 1`: **Setup Slack App to accept incoming webhooks**

Go to https://api.slack.com/apps

Create a new App. Enter name and choose workspace.

Under `Add features and functionality` choose `Incoming Webhooks`.

Toggle `Activate Incoming Webhooks` on.

Add new webhook to workspace -> Select the `channel` you wish to receive message notifications in -> Allow

Make note of the `Webhook URL`, we will need it in the later steps.

### `Step 2`: **Deploy AWS Lambda Function**

I used [Serverless](https://www.serverless.com/) to package and deploy the function. You can use your service of choice.

Make sure your `.env` file looks like `.env.sample`. Paste the `Webhook URL` from above as the `SLACK_HOOK_URL`

```bash
npm install -g serverless
serverless deploy
# If you want to deploy to a specific AWS profile
serverless deploy --aws-profile
```

Make note of the `API Gateway Endpoint` after the function is deployed.

Note:

- Make sure your AWS credentials are set correctly.
- You can change the way the messages look by referring to https://api.slack.com/messaging/composing

### `Step 3`: **Setup outgoing Webhooks on Netlify**

Go to your site on netlify.

Site Settings -> Build & Deploy -> Deploy Notifications

Add Notification -> Outgoing Webhook

Enter the `API Gateway Endpoint` we got from deploying the AWS Lambda.

Note: You will have to do this for every event you want to get a notification for.

## `Demo`

This is what the messages look like in Slack.

messages-sample