This script will generate notifications for the following repository events:
New and closed issue events
Comment events (issues only)
Push events (singular and multiple commits)
Save the settings
The Webhook URL and Token are generated after saving
Copy these credentials, they will be used later
GitHub webhook url and token
GitHub Webhook Setting
After creating the new incoming webhook integration on Rocket.Chat, it is time to link it up with the GitHub repository.
Go to the GitHub project repository then navigate to Settings > Webhooks
Add webhook and fill in the URL and token you copied from the Rocket.Chat setting
Select the list of events you want to be notified on and Add webhook
GitHub webhook setting
After successful configuration, you can test the Webhook with any event trigger and see the notification in your specified Rocket.Chat room.
GitHub webhook notifications
Rocket.Chat GitHub Outgoing Webhook
Sending outgoing webhooks only works on public repositories
Create a new Outgoing WebHook
Select the channel where you will use the commands and receive the responses
Set URLs as https://api.github.com/repos/User-Or-Org-Name/Repo-Name like https://api.github.com/repos/RocketChat/Rocket.Chat
Enable Scripts
Use this Script to listen for commands pr ls, pr list and help
Save your integration
Customizing your integration scripts
The purpose of the integration script is to transform data in one format (the format provided by your incoming service, such as GitHub) into another format (the format expected by Rocket.Chat). Therefore, should you wish to customize either of the scripts presented above, you will need two resources: