Webhook to receive events from GitHub
- Rename
.env.exampleand provide required environment variables - Rename
templates.exampleaccording toTEMPLATES_PATHenvironment variable - Provide code to Yandex Cloud Cloud Function (handler -
main.ya_handler) or create your own one deploy with public URL. - Set up webhook in your repository. Choose events carefully.
Messages templates -- pure Jinja2 templates for creating message to Telegram. Every template is targeted to one of webhook events (x-github-event header) with number of actions.
templates.example is generated by generate_templates.py, list of events provided by official webhook specification
Helpers are special folder for templates enhancements.
Helper functions has special naming declaration:
- Helpers are located in
helpers/directory - One helper function - one python file
- Helper function name = Python file name Webhook tries to load all helper functions on start and provide functions to jinja2 Environment. You will free to provide your own helpers on specific deploy without changing main webhook code repo, like templates.
- Filter sending events.
x-github-eventcan be filtered by GitHub Webhook settings. Each action of event can be filtered by removeifstatement for this action in specified event template.