{"id":27146554,"url":"https://github.com/rustlanges/grhooks","last_synced_at":"2025-07-15T16:11:32.148Z","repository":{"id":286637322,"uuid":"962039555","full_name":"RustLangES/grhooks","owner":"RustLangES","description":"Service to listen and manage github webhooks easy","archived":false,"fork":false,"pushed_at":"2025-06-05T07:42:22.000Z","size":661,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-05T08:30:01.262Z","etag":null,"topics":["github-webhook-listener","github-webhooks","github-webhooks-webservice","rust","rust-lang","rustlang"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RustLangES.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-04-07T14:55:49.000Z","updated_at":"2025-06-05T07:42:24.000Z","dependencies_parsed_at":"2025-06-05T08:26:36.414Z","dependency_job_id":"01263f58-c6c2-4eea-8a1e-56e0a4e9da0b","html_url":"https://github.com/RustLangES/grhooks","commit_stats":null,"previous_names":["rustlanges/grhooks"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/RustLangES/grhooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustLangES%2Fgrhooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustLangES%2Fgrhooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustLangES%2Fgrhooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustLangES%2Fgrhooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RustLangES","download_url":"https://codeload.github.com/RustLangES/grhooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RustLangES%2Fgrhooks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265444911,"owners_count":23766437,"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":["github-webhook-listener","github-webhooks","github-webhooks-webservice","rust","rust-lang","rustlang"],"created_at":"2025-04-08T10:48:05.209Z","updated_at":"2025-07-15T16:11:32.141Z","avatar_url":"https://github.com/RustLangES.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GRHooks - Webhook Server Configuration\n\nGRHooks is a configurable webhook server that can execute commands or scripts in response to incoming webhook events. It supports multiple webhook configurations with flexible command execution options.\n\n## Install prebuilt binaries via shell script\n\n```sh\nbash \u003c(curl -sSL https://raw.githubusercontent.com/RustLangES/grhooks/main/scripts/install.sh)\n```\n\n## Install prebuilt binaries via powershell script\n\n```sh\npowershell -ExecutionPolicy Bypass -c \"$ProgressPreference='SilentlyContinue'; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/RustLangES/grhooks/main/scripts/install.ps1'))\"\n```\n\n## Configuration File\n\nGRHooks uses a configuration file in TOML, YAML, or JSON format. The file should contain the server settings and webhook definitions.\n\n### Example Configuration (TOML)\n\n```toml\nport = 8080\n\n[[webhooks]]\npath = \"deploy\"\nsecret = \"mysecret123\" # or \"${{ env(\\\"MY_SECRET_FROM_ENV\\\") }}\"\nevents = [\"push\", \"pull_request\"]\ncommand = \"echo 'Deployment triggered by ${{event.action}}'\"\n\n[[webhooks]]\npath = \"build\"\nshell = [\"/bin/bash\", \"-c\"]\nscript = \"scripts/build.sh\"\nevents = [\"create\"]\n```\n\n## Configuration Options\n\n### Server Configuration\n\n| Field   | Type   | Description                   | Default | Required |\n| ------- | ------ | ----------------------------- | ------- | -------- |\n| port    | u16    | Port to listen on             | -       | Yes      |\n| verbose | String | Logging verbosity level (0-4) | \"0\"     | No       |\n\n### Webhook Configuration\n\nEach webhook is defined in the `webhooks` array with the following options:\n\n| Field   | Type                | Description                                                            | Required                             |\n| ------- | ------------------- | ---------------------------------------------------------------------- | ------------------------------------ |\n| path    | String              | URL path for the webhook                                               | No (defaults to /)                   |\n| secret  | Option\u003cString\u003e      | Secret for validating webhook signatures                               | No                                   |\n| events  | Vec\u003cString\u003e         | List of events this webhook should handle (use `[\"*\"]` for all events) | Yes                                  |\n| shell   | Option\u003cVec\u003cString\u003e\u003e | Custom shell and arguments to use for command execution                | No (defaults to `/bin/sh -c`)        |\n| command | Option\u003cString\u003e      | Command to execute when webhook is triggered                           | Either command or script must be set |\n| script  | Option\u003cPathBuf\u003e     | Path to script file to execute when webhook is triggered               | Either command or script must be set |\n\n## Template Variables\n\nCommands and scripts can use template variables that will be replaced with values from the webhook payload. Variables use the syntax `${{path.to.value}}`.\n\n\u003e [!NOTE]\n\u003e The template is redered using the [srtemplate](https://github.com/SergioRibera/srtemplate) template engine.\n\n\u003e [!IMPORTANT]\n\u003e If you want to know more about the variables you can use, you should check this [link](https://docs.github.com/es/webhooks/webhook-events-and-payloads#branch_protection_configuration),\n\u003e the hierarchy, names and types are 100% respected in terms of usage, always under the event.\\* name.\n\n### Common Variables\n\n- `${{event.type}}`: The event type that triggered the webhook\n\n## Running GRHooks\n\n### Command Line Usage\n\n```bash\ngrhooks [-v...] /path/to/config.[toml|yaml|json]\n```\n\nOptions:\n\n- `-v`: Increase verbosity (can be used multiple times)\n\n### Environment Variables\n\n- `GRHOOKS_MANIFEST_DIR`: Path to configuration file\n- `GRHOOKS_LOG`: Set logging verbosity (0-4 or trace, info, debug, warning, error)\n\n## Webhook Security\n\nWhen a `secret` is configured in the webhook:\n\n1. GRHooks will validate the `X-Hub-Signature-256` header\n2. Only requests with valid signatures will be processed\n3. The secret should match what's configured in your Git provider\n\n## Example Use Cases\n\n1. **Deployment Automation**:\n\n   ```toml\n   [[webhooks]]\n   path = \"deploy-prod\"\n   events = [\"deployment\"]\n   command = \"kubectl set image deployment/myapp app=${{event.deployment.payload.image}}\"\n   ```\n\n2. **CI/CD Pipeline**:\n\n   ```toml\n   [[webhooks]]\n   path = \"build\"\n   script = \"scripts/ci-pipeline.sh\"\n   events = [\"push\"]\n   ```\n\n3. **Notification System**:\n   ```toml\n   [[webhooks]]\n   path = \"notify\"\n   events = [\"*\"]\n   command = \"curl -X POST -d '{\\\"text\\\":\\\"Event ${{event.type}} received\\\"}' $SLACK_WEBHOOK\"\n   ```\n\n## Supported Webhook Providers\n\nGRHooks currently supports webhooks from:\n\n- GitHub\n- Gitlab\n- [Custom](./crates/origin/README.md)\n\nPlans to support:\n\n- Bitbucket\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustlanges%2Fgrhooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustlanges%2Fgrhooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustlanges%2Fgrhooks/lists"}