And integration to allow reviewing and commenting on pull requests via fax.
- Must have a Twilio Account, and a fax capable phone number (instructions available as part of fax quickstart)
- Must have a Microsoft Cognitive Services Computer Vision resource set up (can be done as part of the Azure free tier)
- Must have a semi recent version of Node installed (built on v13.9.0)
- Must have a GitHub account and at least one repository
- Download repository
- Run
npm install
oryarn install
- Run
cp .env.example .env
to create new.env
file - Fill in env variables in
.env
file from your Twilio account - Use
npm start
to run locally - Use ngrok to expose the page
- In your Twilio Console, edit the fax capable number you're using to send
- Change it to Accept Incoming Faxes (will likely be Voice Calls by default)
- Change the **A Fax comes in ** webhook to be your ngrok url for the
/sent
function, eg.https://92832d0.ngrok.io/sent
- In the settings for your GitHub repository (
https://github.com/{username}/{/settings
), under Webhooks, create a new webhook with the/pr/open
function (eg.https://92832d0.ngrok.io/pr/open
) to be triggered on the Pull requests event
TWILIO_ACCOUNT_SID
- Account SID, found in Twilio Console on DashboardTWILIO_AUTH_TOKEN
- Account Auth Token, found in Twilio Console on DashboardGITHUB_ACCESS_TOKEN
- Personal Access Token for project, generated in GitHub Developer Settings (make sure it has repository access)GITHUB_USERNAME
- Your GitHub UsernameCOMPUTER_VISION_ENDPOINT
- The endpoint for your Computer Vision resource in Azure, should look like{region}.api.cognitive.microsoft.com
where region is the location of your service (list of regions in the Computer Vision API documentation)COMPUTER_VISION_KEY
- The API key for your Computer Vision resource in Azure, found in the Azure portal under the Keys and Endpoint sectionSEND_NUMBER
- The fax capable Twilio number you're sending the fax fromRECEIVE_NUMBER
- The fax number you're sending a fax to
This was a fun project started as part of #TwilioHackathon in April 2020, but if you'd like to there's a couple more things that we wanted to look at doing
- Identify if the user has been selected as a reviewer for the PR
- If the user is a reviewer, adding the review data to the fax
- If the user is a reviewer, fetching the review data from the fax
- If the user is a reviewer, and they use the word "approve" somewhere in their comment, mark the PR as approved
- Link up Sendgrid to the fax part, so that receiving a fax sends the PDF via email, and a fax can be sent via email as well https://www.twilio.com/blog/fax-email-sendgrid-nodejs
- Add code changes to the fax so that the code can be viewed there
- Enable commenting as a different user (identifying user from fax number)