{"id":23054941,"url":"https://github.com/pschichtel/webbed_hook","last_synced_at":"2025-08-20T02:14:18.925Z","repository":{"id":267054259,"uuid":"900139421","full_name":"pschichtel/webbed_hook","owner":"pschichtel","description":"Turn git hooks into webhooks","archived":false,"fork":false,"pushed_at":"2025-08-11T23:34:07.000Z","size":148,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-17T15:52:46.883Z","etag":null,"topics":["git-hooks","git-server","gitlab","webhooks"],"latest_commit_sha":null,"homepage":"https://schich.tel","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pschichtel.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":"2024-12-08T00:51:17.000Z","updated_at":"2025-08-11T23:34:08.000Z","dependencies_parsed_at":"2024-12-08T01:26:13.737Z","dependency_job_id":"a10068ef-5c6a-4801-8de2-776423bd306e","html_url":"https://github.com/pschichtel/webbed_hook","commit_stats":null,"previous_names":["pschichtel/webbed_hook"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/pschichtel/webbed_hook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschichtel%2Fwebbed_hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschichtel%2Fwebbed_hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschichtel%2Fwebbed_hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschichtel%2Fwebbed_hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pschichtel","download_url":"https://codeload.github.com/pschichtel/webbed_hook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pschichtel%2Fwebbed_hook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271252993,"owners_count":24726918,"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-08-20T02:00:09.606Z","response_time":69,"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":["git-hooks","git-server","gitlab","webhooks"],"created_at":"2024-12-16T01:09:20.111Z","updated_at":"2025-08-20T02:14:18.900Z","avatar_url":"https://github.com/pschichtel.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webbed Hook\n\nThis program a rather simple program that\nimplement's [git-receive-pack's hook protocol](https://git-scm.com/docs/git-receive-pack) and translates the invocation\ninto an HTTP request to a URL that is configurable per repository.\n\nThe main purpose of this software is to implement validation hooks (primarily pre-receive hook) by delegating the\ndecision over the web to another application. It is intended to be installed globally (as in: installed in every\nrepository on the server) on a git server, allowing hook configuration per repository using a JSON file.\n\nIt's primarily tested as a GitLab global server hook, and it does process GitLab's `GL_*` environment variables, but it\ndoes _not_ depend on GitLab.\n\nSupported hooks:\n\n* `pre-receive`\n* `update`\n* `post-receive`\n\nThe `post-update` hook is intentionally not available as it has been superseded by the `post-receive`, which provides\nthe same functionality but additional information.\n\n## Installation\n\nInstallation is generally very simple: Just place the binary in the `.git/hooks` folder of the repository named either\n`pre-receive`, `update` or `post-receive`. The process is no different from for any other hook installation. The binary\ncan also be symlinked, which might be desired when installed it for multiple hooks.\n\n### GitLab\n\nThe installation when using GitLab is slightly different and is generally covered\nby [this documentation page](https://docs.gitlab.com/ee/administration/server_hooks.html). GitLab supports per-project\nhooks as well as global hooks and this project also supports both, but global hooks are the primary focus.\n\nGlobal hooks must be enabled first by configuring a `custom_hooks_dir` in gitaly's `hooks` section either directly in\nthe `gitaly/config.toml` or through your `gitlab.rb` configuration (when using an omnibus package).\n\nInside the configured directory you have two options:\n\n1. Place the binary directly in there similar to the `.git/hooks` for git repositories.\n2. Create `\u003chook\u003e.d` subfolders, so `pre-receive.d`, `update.d` and/or `post-receive.d`, and place the binary in any of\n   these folders with an arbitrary name.\n\nOnce again, both options are supported by this project.\n\n## Hook Configuration\n\nNo matter how the hook is installed, by default no action is performed and the process terminated very quickly without\nside effects.\n\nIn order to activate hooks for a repository the repository's default branch must contain a file called `hooks.json`.\nThe file follows the schema defined in [`config.schema.json`](config.schema.json), so please check that and/or configure\nyour text editor to use it for completion and validation.\n\nOn the top-level sections exist for each supported hook with the same name and each section has the same options.\n\nMore details are available in the following example and in the schema definition.\n\n### Example\n\n```json5\n// $schema: config.schema.json\n{\n  // Currently it must always be `1`.\n  \"version\": \"1\",\n  // Probably the most important hook, but the sections for `update` and `post-receive` are identical\n  \"pre-receive\": {\n    // This section configures which refs should be subject to the hook.\n    // At least once selector must exist. \n    \"ref-selectors\": [\n      {\n        \"type\": \"branch\",\n        \"name\": \"main\"\n      },\n      {\n        \"type\": \"tag\",\n        \"name\": \"v1.0.0\"\n      },\n      {\n        \"type\": \"ref-regex\",\n        // Limitations apply, see: https://github.com/rust-lang/regex\n        \"pattern\": \"^refs/heads/.+$\"\n      }\n    ],\n    // The target url for the webhook. See the following section for details.\n    \"url\": \"https://example.org/webhook\",\n    // This option takes arbitrary JSON and passes it on to the webhook.\n    \"config\": {\n      \"some key\": \"some value\"\n    },\n    // Whether to reject the hook when anything regarding the webhook request failed.\n    \"reject-on-error\": true,\n    \"request-timeout\": 1000,\n    \"connect-timeout\": 1000,\n    // Optional messages always printed to the client before performing the webhook.\n    \"greeting-messages\": [\n      \"Hi there!\"\n    ],\n    // Whether to include a patch file (git-format-patch) for the changes.\n    \"include-patch\": true,\n    // Whether to include a commit log (git-log) for the changes.\n    \"include-log\": true,\n    // allow bypassing this specific hook by a push option and optionally print messages to the client \n    \"bypass\": {\n      \"push-option\": \"some_option_name\",\n      \"messages\": [\n        \"Hooks bypassed by global option\"\n      ]\n    }\n  },\n  // allow bypassing any of the configured hooks by a push option and optionally print messages to the client \n  \"bypass\": {\n    \"push-option\": \"some_option_name\",\n    \"messages\": [\n      \"Hooks bypassed by global option\"\n    ]\n  }\n}\n```\n\n## Webhook Receivers\n\nThe webhook receiver application can be any HTTP/1.1-capable web server, that can accept a request. The request will\ncarry a body of type `application/json` including all information about the hook invocation and its context. Its schema\nis described in [`request.schema.json`](request.schema.json). The receiver can respond with any HTTP status code in the\n200-299 range to accept the hook execution and with any other status code to reject it.\n\nOptionally the response can have a body of type `application/json` in order to provide information about why the hook\nwas accepted or rejected. Its schema is described in [`response.schema.json`](response.schema.json). Accept messages\nwill be printed to stdout, rejection messages will be printed to stderr.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpschichtel%2Fwebbed_hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpschichtel%2Fwebbed_hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpschichtel%2Fwebbed_hook/lists"}