Send informations from GitHub to Twitter
Create a webhook on GitHub:
Choose a repository on GitHub that you want to read issues to post on Twitter. Enter on Settings and configure a new webhook.
To test webhook locally and set a URL on GitHub, we recomend you to use ngrok
Create an app on Twitter:
Create a new app on https://apps.twitter.com/, and configure to read and write.
Environment Variables:
Create a copy of the file .env.example called .env. Then, just configure some environment variables inside this file:
PORT: Port to run the server. Default is8080GITHUB_SECRET: GitHub secret on webhook configurationCONSUMER_KEY: Twitter Consumer KeyCONSUMER_SECRET: Twitter Consumer SecretACCESS_TOKEN_KEY: Twitter Access Token KeyACCESS_TOKEN_SECRET: Twitter Access Token Secret
/api/webhookis the route to configure on GitHub app/api/tweetis the route to configure as callback on Twitter app
yarn dev: Run local dev server
It will just tweet on production environment. To force tweet on development environment, edit index.js, on line 59, and pass 'production' by parameter for isProduction function.
This repository is ready to run inside Heroku.