Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

saucelabs/sauce-slack-webhook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sauce-slack-webhook

This Cloud Run service written in nodejs receives Sauce Labs webhooks, and converts and sends them to a Slack Incoming Webhook URL.

passing_test

failing_test

The instructions below takes you through creating the Slack Incoming Webhook, deploying the service to Google Cloud, and hooking it up with Sauce Labs' webhook mechanism.

Instructions

  1. Create a Slack Incoming Webhook
  2. Build and deploy the service to Google Cloud
  3. Integrate with Sauce Labs Webhook

1. Create Slack Incoming Webhook

slack-incoming-webhook

  • Add apps (under Apps at bottom)
  • Search 'Incoming Webhooks'
  • Click Add under 'Incoming Webhooks' under Available Apps
  • Click 'Add to Slack'
  • Select a channel
  • Click 'Add Incoming Webhooks integration'
  • Note the Webhook URL = slack_webhook_url

2. Deploy to Google Cloud

Pre-requisite: Setup Google Cloud

Build and deploy to Google Cloud

3. Integrate with Sauce Labs Webhook

saucelabs-webhook

Testing Locally (Optional)

Pre-requisites

Create a Slack App

A Slack app is required to use the Slack API to search messages in a channel

  • https://api.slack.com/methods/search.messages
  • https://api.slack.com/apps
  • Click 'Create New App'
  • From Scratch
  • App Name = Sauce Slack Webhook
  • Select workspace
  • Click 'Permissions'
  • Under 'User Token Scopes', click 'Add an OAuth Scope'
  • Select 'search:read'
  • Scroll up and click 'Install to Workspace'
  • Click 'Allow'
  • In Slack, invite this Slack App into the channel associated with the Slack Webhook

Set Environment Variables

  • SLACK_WEBHOOK_URL - from Step 1 above
  • SLACK_APP_TOKEN - retrieve from the 'Install App' under 'Settings'

Run service locally and send a test message to Slack

Run service in a local server

  • npm start

Send the test message

In separate terminal,

  • npm test

About

Receives Sauce Labs webhook events, and converts and sends them to a Slack webhook URL

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published