{"id":21091368,"url":"https://github.com/andreasscherbaum/gh-notifications","last_synced_at":"2026-05-13T07:43:20.227Z","repository":{"id":150259116,"uuid":"240602721","full_name":"andreasscherbaum/gh-notifications","owner":"andreasscherbaum","description":"Notifications for GitHub Webhook events","archived":false,"fork":false,"pushed_at":"2022-12-03T01:47:48.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-21T01:13:55.953Z","etag":null,"topics":["gh-notifications","git","github","github-webhooks","notification","notifications","payload","payloads","python","python3","secret","webhook","webhooks"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreasscherbaum.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-02-14T21:36:49.000Z","updated_at":"2022-12-03T01:47:52.000Z","dependencies_parsed_at":"2023-05-02T21:53:41.661Z","dependency_job_id":null,"html_url":"https://github.com/andreasscherbaum/gh-notifications","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasscherbaum%2Fgh-notifications","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasscherbaum%2Fgh-notifications/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasscherbaum%2Fgh-notifications/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreasscherbaum%2Fgh-notifications/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreasscherbaum","download_url":"https://codeload.github.com/andreasscherbaum/gh-notifications/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243532988,"owners_count":20306237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gh-notifications","git","github","github-webhooks","notification","notifications","payload","payloads","python","python3","secret","webhook","webhooks"],"created_at":"2024-11-19T21:45:22.620Z","updated_at":"2026-05-13T07:43:15.189Z","avatar_url":"https://github.com/andreasscherbaum.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gh-notifications\n\nNotifications for GitHub Webhook events\n\n\n## About\n\nThis script is used to \"catch\" and process [GitHub Webhook events](https://developer.github.com/webhooks/), and generate an useful email from the payload.\n\n\n## Dependencies\n\nThis script is written in Python.\n\nThe following modules are used:\n\n* sys\n* os\n* json\n* smtplib\n* email.message\n* email.mime.text\n* email.utils\n* subprocess\n\n\n## Install Webhook\n\nIn the Repository settings, click on \"Webhooks\". Click \"Add webhook.\"\n\nAs \"Payload URL\" specify the website which uses this script here.\n\nContent type: application/x-www-form-urlencoded\n\nSpecify a Secret.\n\nEnable SSL verification (you better have this enabled for your webhook service).\n\nSpecify that all events (not just commits) shall trigger the webhook.\n\nFinally, click \"Add webhook\".\n\n\n## Using 'webhook' with this script\n\nThe [webhook](https://github.com/adnanh/webhook) tool can be used to receive GitHub Webhooks. I blogged about the setup [here](https://andreas.scherbaum.la/blog/archives/987-webhook-service-with-TLS-and-Lets-Encrypt-certificate.html).\n\nThe following is an example how to setup _webhook_:\n\n```\n[\n  {\n    \"id\": \"github\",\n    \"execute-command\": \"/path/to/github.py\",\n    \"command-working-directory\": \"/tmp\",\n    \"pass-arguments-to-command\":\n    [\n        {\n          \"source\": \"string\",\n          \"name\": \"no-reply@your.domain\"\n        },\n        {\n          \"source\": \"string\",\n          \"name\": \"address@your.domain\"\n        },\n        {\n          \"source\": \"header\",\n          \"name\": \"X-Github-Event\"\n        },\n        {\n          \"source\": \"entire-payload\"\n        }\n    ],\n    \"response-message\": \"OK\",\n    \"trigger-rule\":\n    {\n        \"match\":\n        {\n            \"type\": \"payload-hash-sha1\",\n            \"secret\": \"secret\",\n            \"parameter\":\n            {\n                \"source\": \"header\",\n                \"name\": \"X-Hub-Signature\"\n            }\n        }\n    }\n  }\n]\n```\n\nA few things need to be replaced:\n* \"no-reply@your.domain\": that is the email address used as \"From\" in any email\n* \"address@your.domain\": that is the email receiver\n* \"/path/to/github.py\": the path to the _github.py_ script\n* \"id\": that is the URL path for _webhook_\n* \"secret\": the secret entered into the GitHub webhook page\n\n\n## Recognized GitHub events\n\nCurrently this script recognizes the following GitHub events:\n* ping\n* push\n* repository\n* watch\n* star\n* issues\n* member\n* commit_comment\n* issue_comment\n* fork\n* pull_request\n* pull_request_review\n* pull_request_review_thread\n* pull_request_review_comment\n* meta\n* create\n* delete (branch)\n* repository_vulnerability_alert\n* project\n* label\n* check_run\n* check_suite\n* workflow_job\n* workflow_run\n* deploy_key\n* branch_protection_rule\n* dependabot_alert\n* status\n\nIt will generate an email with details about unknown events.\n\n\n## pre-commit hook\n\nThe included file _pre-commit_ can be placed in _.git/hooks_ and will ensure that the _README.md_ is updated if changes are applied to the Python script.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreasscherbaum%2Fgh-notifications","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreasscherbaum%2Fgh-notifications","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreasscherbaum%2Fgh-notifications/lists"}