- Stitch >
- External Services >
- Built-In Services >
- GitHub Service
GitHub Snippets¶
The code snippets on this page cover demonstrate how you can respond to events in a GitHub repository through the GitHub Service. All of the snippets require a GitHub Service interface with rules that allow the service actions used in the snippet.
If your app does not have a GitHub Service interface, create one before using these snippets.
GitHub Snippets
Log All Commits In MongoDB¶
This GitHub incoming webhook function records all commits pushed to a repo in MongoDB based on a PushEvent payload from GitHub.
Automatically Comment On New Pull Requests¶
This GitHub incoming webhook function adds a comment to new pull requests that thanks users for submitting. The webhook accepts a PullRequestEvent payload from GitHub and uses an HTTP service client to create a comment through the GitHub API.