You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Nicolas Garnier b33a83d270 Adding pont asking to enable billing in the GitHub to Slack example. 8 years ago
..
functions Updating version of the firebase-functions module in package.json files to launch version 8 years ago
README.md Adding pont asking to enable billing in the GitHub to Slack example. 8 years ago
firebase.json Polishing, simplifying and Adding README to the GitHub to Slack sample 8 years ago

README.md

Post GitHub commits to Slack channel.

This sample shows how to automatically post GitHub commits to a Slack channel using an HTTPS Cloud Function.

Further reading:

Functions Code

See file functions/index.js for the code.

Handling the Google Actions requests is done using the Google Actions SDK.

The dependencies are listed in functions/package.json.

Deploy and test

To test this sample action:

  • Create a Firebase Project using the Firebase Developer Console
  • Enable billing on your project by switching to the Blaze or Flame plan. See pricing for more details. This is required to be able to do requests to non-Google services.
  • Configure this sample to use your project using firebase --use add and select your project.
  • Add a WebHook to your GitHub repo with the following settings:
    • Payload URL: https://us-central1-<FIREBASE_PROJECT_ID>.cloudfunctions.net/githubWebhook
    • Content type: application/json
    • Secret: A_SECRET_YOU_DEFINE
    • Which events would you like to trigger this webhook? Just the push event.
  • Add an Incomming Webhook to your Slack channel and take note of the Webhook URL.
  • Set the slack.webhook_url and github.secret Google Cloud environment variables to match the email and password of the Gmail account used to send emails. For this use:
    firebase functions:config:set slack.webhook_url="https://hooks.slack.com/services/..." github.secret="A_SECRET_YOU_DEFINED_WHEN_SETTING_UP_THE_GITHUB_WEBHOOK"
    
  • Deploy your project using firebase deploy
  • Make your action available for testing using the gactions preview action.json
  • Test your Action on the Google Home Web Simulator by saying "Talk to My Action"