# GitHub and Workbot for Slack recipe
This use case guides you through connecting GitHub and Workbot for Slack to create a powerful automation.
# What does this recipe do?
This recipe monitors GitHub for new or updated milestones and automatically posts milestone details to Slack using Workbot for Slack.
# How can I use this recipe?
You can use this recipe to track milestones in GitHub and post updates to your Slack channel in real time. You can also modify this recipe to work with real-time triggers for GitHub issues, pull requests, or issue comments.
# Create your recipe
Complete the following steps to create a recipe that monitors GitHub for new or updated milestones and automatically posts milestone details to Slack using Workbot for Slack:
USE CASES ARE INTENDED AS EXAMPLES ONLY
This use case is intended to serve as an example. Recipe modifications such as trigger and action configuration and conditional logic may require adjustments if you plan to include this recipe in your own workflow.
Sign in to your Workato account and go to the workspace project where you plan to add the recipe.
Set up connections for GitHub and Workbot for Slack using the steps in the following sections:
Set up your GitHub connection.
Click Create > Connection.
Search for and select GitHub
as your connection in the New connection page.
Provide a name for your connection in the Connection name field.
GitHub connection setup
Use the Location drop-down menu to select the project where you plan to store the connection.
Use the Connection type drop-down menu to select the connection method you plan to use. You can select your on-premise group name or select Cloud to use a direct connection.
Select either OAuth App, GitHub App, or Personal Access Token in the Authentication type drop-down menu.
If you selected GitHub App:
Provide your app ID in the GitHub App ID field.
Enter the private key in the GitHub App Private key field.
Fill in the Installation ID field.
Optional. Expand Advanced configuration to provide the API Root URL, which is applicable when using GitHub Enterprise Server.
If you selected Personal Access Token:
Enter your personal access token in the Personal Access Token field.
Click Connect.
Set up your Workbot for Slack connection.
Click Create > Connection.
Search for and select Workbot for Slack
in the New Connection page.
Provide a name for your connection in the Name field.
Workbot for Slack connection setup
Use the Location drop-down menu to select the project where you plan to store the connection.
Optional. Select the NLU provider you plan to use, such as DialogFlow or Amazon Lex NLU. You must connect to the NLU provider for it to appear in the drop-down menu.
Optional. Click Advanced to configure Slash commands verification tokens, custom help content, your Slack app status (classic or not), and your Custom OAuth profile.
Click Connect, sign in to your Slack workspace when prompted, and click Continue to verify the connection.
Click Create > Recipe.
Provide a name for your recipe in the Name field and select the project in which you plan to store the recipe from the Location drop-down menu.
Ensure that Trigger from an app is selected under Pick a starting point and click Start building.
Set up your recipe
Set up your GitHub New or updated milestone trigger.
Search for and select GitHub
in the Choose an app search box.
Choose GitHub
Select New or updated milestone as your trigger.
Select the New or updated milestone real-time trigger
Select the GitHub connection you created in the preceding steps.
Select the organization that contains the repository you plan to access from the Organization drop-down menu.
Select your repository in the Repository name field.
Select All from the Action drop-down menu to monitor all milestone statuses. Additional options include the following statuses:
- Opened milestone
- Closed milestone
- Created milestone
- Deleted milestone
- Edited milestone
Configure the New or updated milestone trigger
Click Save.
Step summary
This trigger monitors the GitHub repository you specify for new or updated milestones in real-time.
Click the +
Add step button and select IF condition.
Click Add step > IF condition
How do IF conditions work?
An IF condition enables you to make decisions based on specific conditions. You can control your recipe workflow by executing different actions depending on whether a condition you specify is true or false.
Set up your IF condition.
Map the GitHub Created at | Step 1
datapill to Data field.
Use the Condition drop-down menu to select equals.
Map the GitHub Updated at | Step 1
datapill to the Value field.
IF condition configuration
Click Save.
Step summary
This step checks if the milestone is new by comparing the Created at and Updated at timestamps. If the values are identical, the milestone is considered new.
Click Select an app and action.
Set up your Workbot for Slack Post message action.
Search for and select Workbot for Slack
in the Choose an app search box.
Choose Workbot for Slack
Select Post message as your action.
Select the Post message action
Enter the channel name where you plan for Workbot to post milestone updates in the Channel name/DM field, including the #
prefix. For example, use #general
.
Click Add block to message in the Message field.
Click Add block to message
Go to the New block field and use the Type drop-down menu to select Section with text.
Type *New milestone in GitHub*
in the Section text field.
Fill out the Section text field
Click Add block to message.
Go to the second New block field and use the Type drop-down menu to select Section with fields.
Go to the Section text field and perform the following actions:
Type <
.
Map the GitHub Html URL | Step 1
datapill.
Type |*
.
Map the GitHub Title | Step 1
datapill.
Type *>
.
Enter a new line and map the GitHub Description | Step 1
field.
Configure the Section text field
Go to Attachment fields and click Add field.
Click Add field
Go to Field #1 and type *ID*:
in the Title field.
Map the GitHub ID | Step 1
datapill to the Value field.
Click + Add field.
Go to Field #2 and type *Number*:
in the Title field.
Map the GitHub Number | Step 1
datapill to the Value field.
Click + Add field.
Go to Field #3 and type *State*:
in the Title field.
Switch the Value field to formula mode, map the GitHub State | Step 1
datapill, and append the .capitalize
formula.
Map the State datapill and append the capitalize formula
Click + Add field.
Go to Field #4 and type *Created at*:
in the Title field.
Switch the Value field to formula mode and perform the following actions:
Map the GitHub Created at | Step 1
datapill.
Append the .in_time_zone
formula and specify the timezone. For example, to view times in Pacific Standard Time, type ("America/Los Angeles")
.
Append the .strftime
formula to format the datetime string in your preferred format. You can enter the following: ("%B%e, %Y,%l:%M %p")
Created at value configuration
Click + Add field.
Go to Field #5 and type *Open issues*:
in the Title field.
Map the GitHub Open issues | Step 1
datapill to the Value field.
Click + Add field.
Go to Field #6 and type *Closed issues*:
in the Title field.
Map the GitHub Closed issues | Step 1
datapill to the Value field.
Click Add block to message.
Expand the third New block field and select Divider from the Type drop-down menu.
Click Save.
Step summary
This step posts a message to your specified Slack channel with details about the new GitHub milestone.
Click the +
Add step button and select ELSE IF condition.
Click Add step > ELSE IF condition
How do ELSE IF conditions work?
If the IF condition is false, the ELSE IF condition is evaluated. You can chain multiple ELSE IF conditions, as demonstrated by this recipe.
Refer to the IF control statement documentation to learn more.
Set up your ELSE IF condition.
Map the GitHub Created at | Step 1
datapill to Data field.
Use the Condition drop-down menu to select does not equal.
Map the GitHub Updated at | Step 1
datapill to the Value field.
Click +
(plus) and select AND to add a second condition.
Map the GitHub Closed at | Step 1
datapill to Data field.
Use the Condition drop-down menu to select is not present.
ELSE IF condition configuration
Click Save.
Step summary
This step checks if the milestone has been updated by comparing the Created at and Updated at timestamps. It also ensures the milestone is not closed by verifying that the Closed at field is null.
Click the …
(ellipsis) next to Step 3 in the recipe editor and select Copy, or press Command+C after you select the step.
Copy step 3
Hover over Step 5 and click Paste.
Paste the Post message step
Click the …
(ellipsis) next to the extra step in the recipe editor and select Delete.
Delete the extra step
Set up your Workbot for Slack Post message action.
Click the pasted Workbot for Slack Post message action.
Go to Message > Section with text > Section text and change *New milestone in GitHub*
to *Updated milestone in GitHub*
.
Updated milestone in GitHub
Go to Attachment fields > Field #4 > Title and change *Created at*:
to *Updated at*:
.
Replace the Created at | Step 1
datapill with the Updated at | Step 1
datapill in the Value field.
Map the Updated at datapill
Step summary
This step posts a message to your specified Slack channel with details about the updated GitHub milestone.
Click the +
Add step button and select ELSE IF condition.
Click Add step > ELSE IF condition
Set up your second ELSE IF condition.
Map the GitHub Closed at | Step 1
datapill to Data field.
Use the Condition drop-down menu to select is present.
ELSE IF condition configuration
Click Save.
Step summary
This step checks if the milestone is closed by checking if the Closed at field contains a value.
Click the …
(ellipsis) next to Step 3 in the recipe editor and select Copy, or press Command+C after you select the step.
Copy step 3
Hover over Step 7 and click Paste.
Paste the Post message step
Click the …
(ellipsis) next to the extra step in the recipe editor and select Delete.
Delete the extra step
Set up your Workbot for Slack Post message action.
Click the pasted Workbot for Slack Post message action.
Go to Message > Section with text > Section text and change *New milestone in GitHub*
to *Closed milestone in GitHub*
.
Closed milestone in GitHub
Go to Attachment fields > Field #4 > Title and change *Created at*:
to *Closed at*:
.
Replace the Created at | Step 1
datapill with the Closed at | Step 1
datapill in the Value field.
Map the Closed at datapill
Step summary
This step posts a message to your specified Slack channel with details about the closed GitHub milestone.
Your GitHub and Workbot for Slack recipe is ready to test and implement.
Example recipe configuration.
GitHub and Workbot for Slack recipe
Last updated: 11/4/2024, 6:09:46 PM