{"id":15409488,"url":"https://github.com/xpaw/github-webhook","last_synced_at":"2025-10-04T08:21:50.792Z","repository":{"id":14687027,"uuid":"17406648","full_name":"xPaw/GitHub-WebHook","owner":"xPaw","description":"🐱 Validates and processes GitHub's webhooks","archived":false,"fork":false,"pushed_at":"2025-07-20T18:42:33.000Z","size":310,"stargazers_count":31,"open_issues_count":2,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-09-22T22:38:49.313Z","etag":null,"topics":["github","github-webhooks","irc","parsing","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xPaw.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,"zenodo":null}},"created_at":"2014-03-04T15:22:14.000Z","updated_at":"2025-07-20T18:42:36.000Z","dependencies_parsed_at":"2023-01-13T18:04:04.619Z","dependency_job_id":"7701c966-db07-4be4-bf5f-43a2a7743517","html_url":"https://github.com/xPaw/GitHub-WebHook","commit_stats":{"total_commits":248,"total_committers":6,"mean_commits":"41.333333333333336","dds":"0.33870967741935487","last_synced_commit":"c851d3665c703942075eb4c456feddb4b2539e86"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/xPaw/GitHub-WebHook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xPaw%2FGitHub-WebHook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xPaw%2FGitHub-WebHook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xPaw%2FGitHub-WebHook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xPaw%2FGitHub-WebHook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xPaw","download_url":"https://codeload.github.com/xPaw/GitHub-WebHook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xPaw%2FGitHub-WebHook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278284043,"owners_count":25961422,"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","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["github","github-webhooks","irc","parsing","php"],"created_at":"2024-10-01T16:40:15.179Z","updated_at":"2025-10-04T08:21:50.775Z","avatar_url":"https://github.com/xPaw.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"This script acts as a web hook for [GitHub](https://github.com/) events, processes them,\nand returns messages which can be sent out to an IRC channel or a Discord webhook,\ndepending on the converter used.\n\nSee `examples/discord.php` for a basic application that sends webhooks to Discord.  \nSee `examples/irker.php` for a basic application that sends messages to IRC.  \n\n## GitHubWebHook\n`GitHubWebHook.php` accepts, processes and validates an event,\nit also can make sure that the event came from a GitHub server.\n\nFunctions in this class are:\n\n#### ProcessRequest()\nAccepts an event, throws `Exception` on error.\n\n#### GetEventType()\nReturns event type.\nSee https://developer.github.com/webhooks/#events for a list of events.\n\n#### GetPayload()\nReturns decoded JSON payload as an object.\n\n#### GetFullRepositoryName()\nReturns full name of the repository for which an event was sent for.\n\n#### ValidateHubSignature( $SecretKey )\nRetuns true if HMAC hex digest of the payload matches GitHub's, false otherwise.\n\n## IrcConverter\n`IrcConverter.php` accepts input from previous script and outputs\na colored string which can be sent to IRC.\n\n#### __construct( $EventType, $Payload )\n`IrcConverter` constructor takes 3 paramaters (last one is optional).\nAll you need to do is pass data after parsing the message with `GitHubWebHook`\nlike so: `new IrcConverter( $Hook-\u003eGetEventType(), $Hook-\u003eGetPayload() );`\n\nURL shortener paramater takes a function, and that function should accept\na single string argument containing an url. If your function fails to\nshorten an url or do anything with it, your function must return the\noriginal url back.\n\n#### GetMessage()\nAfter calling the constructor, using this function will return\na string which can be sent to an IRC server.\n\nThrows `NotImplementedException` when you pass an event that\nis not parsed anyhow, and throws `IgnoredEventException` for\n`fork`, `watch` and `status` events which are ignored by design.\n\n## Events [\\[ref\\]](https://docs.github.com/en/free-pro-team@latest/developers/webhooks-and-events/webhook-events-and-payloads)\n\nTrack changes to GitHub webhook payloads documentation here: https://github.com/github/docs/commits/main/data/reusables/webhooks\n\n### Supported events\n\n- commit_comment\n- delete\n- discussion\n- discussion_comment\n- gollum\n- issue_comment\n- issues\n- member\n- milestone\n- package\n- ping\n- project\n- public\n- pull_request\n- pull_request_review\n- pull_request_review_comment\n- push\n- release\n- repository\n- repository_vulnerability_alert\n\n### Not yet supported events\n\n- check_run\n- check_suite\n- code_scanning_alert\n- deploy_key\n- deployment\n- deployment_status\n- label\n- membership\n- meta\n- org_block\n- organization\n- page_build\n- project_card\n- project_column\n- repository_import\n- sponsorship\n- team\n- team_add\n\n### Events ignored by design\n\n- create - Formatted from push event instead\n- fork\n- star\n- status\n- watch\n\nAdditionally, events like labelling or assigning an issue are also ignored.\nPush event ignores branch deletions (use delete event instead).\n\n### Events that can not be supported\n\n- content_reference\n- github_app_authorization\n- installation\n- installation_repositories\n- marketplace_purchase\n- repository_dispatch\n- security_advisory\n- workflow_dispatch\n- workflow_run\n\n## License\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxpaw%2Fgithub-webhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxpaw%2Fgithub-webhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxpaw%2Fgithub-webhook/lists"}