Skip to content
This repository has been archived by the owner on Jul 14, 2018. It is now read-only.
/ push2email Public archive

A self-hosted Google Apps Script project that delivers push event details from GitHub to your inbox

License

Notifications You must be signed in to change notification settings

swinton/push2email

Repository files navigation

push2email

A self-hosted Google Apps Script project that delivers push event details from GitHub to your inbox

push2email may be used as a self-hosted replacement to the email service that is due to be deprecated on January 31, 2019.

Installation

  1. Setup
  2. Build
  3. Deploy
  4. Authorize
  5. Configure script properties
  6. Get your project's webhook URL
  7. Configure your repository to send push event to your project's webhook URL

Setup

  1. Clone this repo
  2. Install dependencies npm install
  3. Install Google's Clasp npm i @google/clasp -g, clasp login
  4. Create a Clasp project clasp create push2email

Build

  1. npm run-script build

Deploy

  1. Push the project: clasp push
  2. Deploy the project: clasp deploy

Authorize

  1. Open your project in your browser: clasp open
  2. ...

Configure script properties

To specify an email address to which push event details will be delivered:

  1. Open your project in your browser: clasp open
  2. Navigate to File > Project properties, select the Script properties tab
  3. Add a new row, enter RECIPIENT_EMAIL as the property, and a valid email address as the value

Get your project's webhook URL

Once deployed, you can lookup the webhook URL for your project.

Your project's webhook URL is of the form:

https://script.google.com/macros/s/${DEPLOYMENT_ID}/exec

Where ${DEPLOYMENT_ID} is the ID of a deployment of your project. To look up the deployments with Clasp, run clasp deployments, this will generate output like the following:

2 Deployments.
- AKfycbw6KfHThp5GkM4PJfvHVSts-8g1jBjtcN-kOYfjyg @HEAD
- AKfycbwOgu_KUrNGOKmyj7oCI2rsZemH9y9PMOcC5tomM_6iibfoUUJ2vM3wZC740X2IzBk @1

So, in this instance, the deployment ID for version 1 (indicated by @1 in the above output) is AKfycbwOgu_KUrNGOKmyj7oCI2rsZemH9y9PMOcC5tomM_6iibfoUUJ2vM3wZC740X2IzBk. The webhook URL for this deployment, therefore, is https://script.google.com/macros/s/AKfycbx7mw535PmMPqUzXMPCI_0GQ5aLAZfDbqiNSiQAYEWbd2RXLj8LtMMlgu7XHUMnbDg/exec.

Configure your repository to send push event to your project's webhook URL

Configure a webhook via your repository's settings page.

  1. Payload URL is your project's webhook URL
  2. Content type is application/json
  3. Trigger the webhook with just the push event
  4. Make sure it's set to active ✅

You're all set, pushes to your repository will now trigger an email to the address you specified 🚀

About

A self-hosted Google Apps Script project that delivers push event details from GitHub to your inbox

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published