How to integrate Buddy with IFTTT to automatically create GitHub issues
IFTTT is one of the most popular services (if not the most popular) that you can use to create simple conditional statements for all your internet-connected things, including your favorite Continuous Delivery service.
In this guide we'll show you how to configure IFTTT to automatically create an issue in your GitHub repository when something wrong goes in the pipeline (eg. a build fails).
Actions used in this guide:
Create a new IFTTT applet
Let's starting with creating a new IFTTT applet that will act as a bridge between GitHub and Buddy.
Login to your IFTTT profile, go to My Applets and create a New Applet:
Image loading...
Click +ifthis and look up Webhooks:
Image loading...
Click Receive a web request, set the event name (eg.
build_failed
), and click Create Trigger when done:Image loading...
Click +that and look up GitHub:
Image loading...
- Sign in to your GitHub account and authenticate IFTTT.
Click Create an issue and enter the details:
- Repository where the issue will be created
- Title of the issue
Body of the issue
Image loading...
When ready, click Create action, review and Finish:
Image loading...
Configure the webhook in Buddy
The applet is ready. Let's create a pipeline that will trigger the event in IFTTT and update the contents of the message with custom information:
- Add a new pipeline and set the Trigger mode to On every push.
Image loading...
- Add a build action for your type of application (eg. Node.js).
Add Send HTTP request to Actions run on failure. This way the request will be sent only if the primary action has failed.
Image loading...
Enter the details of the IFTTT ingredient in the payload, for example:
![Specifying IFTTT in the payload](/guides/images/ifttt/ifttt-9.png)http{ "value1": "${execution.to_revision.revision}", "value2": "${execution.to_revision.committer.name}", "value3": "${execution.action_executions[0].log_url}" }
In the Endpoint URL, paste the token from IFTTT. You can find it at the Webhook's maker page under Documentation in your IFTTT profile.
Image loading...
Click Add this action when ready.
Congratulations! You can use Buddy to automatically issue tasks in GitHub if something goes wrong. To test the action, try messing something up (eg. build commands) and make a push – if everything was configured correctly, a new issue will apear in GitHub:
Image loading...
Using environment variables to store IFTTT token
You can store the webhook token as a variable to use it in later on other actions:
- Go to the pipeline settings and click Variables
Enter the Name for the variable (eg. IFTTT_TOKEN) and paste the Value.
Image loading...
When ready, click Add to save changes
This way, the Endpoint URL will look like this:
defaulthttps://maker.ifttt.com/trigger/build_failed/with/key/${IFTTT_TOKEN}
Summary
This is the first of the upcoming series of IFTTT recipies that we're planning to add. If you have an idea for a cool recipe for Buddy, feel free to drop a word to support@buddy.works.
Jarek Dylewski
Customer Support
A journalist and an SEO specialist trying to find himself in the unforgiving world of coders. Gamer, a non-fiction literature fan and obsessive carnivore. Jarek uses his talents to convert the programming lingo into a cohesive and approachable narration.