{"id":19096605,"url":"https://github.com/sapcc/webhook-broadcaster","last_synced_at":"2025-04-30T14:15:36.400Z","repository":{"id":36044152,"uuid":"144867091","full_name":"sapcc/webhook-broadcaster","owner":"sapcc","description":"Distribute webhooks to multiple resource in concourse.","archived":false,"fork":false,"pushed_at":"2025-04-11T20:33:28.000Z","size":179,"stargazers_count":18,"open_issues_count":6,"forks_count":7,"subscribers_count":48,"default_branch":"master","last_synced_at":"2025-04-19T03:36:32.370Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/sapcc.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":"2018-08-15T14:57:19.000Z","updated_at":"2025-02-18T08:20:44.000Z","dependencies_parsed_at":"2024-04-03T20:23:10.118Z","dependency_job_id":"2f9a14a2-4de8-4250-9d55-f6a259e6e702","html_url":"https://github.com/sapcc/webhook-broadcaster","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/sapcc%2Fwebhook-broadcaster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Fwebhook-broadcaster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Fwebhook-broadcaster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sapcc%2Fwebhook-broadcaster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sapcc","download_url":"https://codeload.github.com/sapcc/webhook-broadcaster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251719480,"owners_count":21632685,"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":[],"created_at":"2024-11-09T03:37:13.074Z","updated_at":"2025-04-30T14:15:36.244Z","avatar_url":"https://github.com/sapcc.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Concourse webhook broadcaster\n=============================\n\nThis repo contains a small service that is meant to be run as a sidecar to a concourse deployment.\n\nIts purpose is to process incoming webhooks from a github repository and broadcast them to all concourse\nresources that reference the git repository.\n\n\n```\n  ┌─────────────┐\n┌─┤  Concourse  ├────────────────┐                                           ┌─────────────────────┐\n│ └─────────────┘                │                                         ┌─┤ Github (Enterprise) ├─┐\n│ ┌────────────────────────────┐ │                                         │ └─────────────────────┘ │\n│ │name: resource1             │ │                                         │                         │\n│ │type: git                   │ │                                         │                         │\n│ │source:                     │◀┼─┐                                       │                         │\n│ │  uri: github.com/some/where│ │ │                                       │                         │\n│ └────────────────────────────┘ │ │                                       │                         │\n│ ┌────────────────────────────┐ │ │    ┌─────────────────────┐            │                         │\n│ │name: resource2             │ │ │    │                     │            │ ┌─────────────────────┐ │\n│ │type: git                   │ │ │    │                     │    push    │ │     repository:     │ │\n│ │source:                     │◀┼─┼────│ Webhook Broadcaster │◀───────────┼─│     some/where      │ │\n│ │  uri: github.com/some/where│ │ │    │                     │   webhook  │ └─────────────────────┘ │\n│ └────────────────────────────┘ │ │    │                     │            │                         │\n│ ┌────────────────────────────┐ │ │    └─────────────────────┘            │                         │\n│ │name: resource3             │ │ │                                       │                         │\n│ │type: git                   │ │ │                                       │                         │\n│ │source:                     │◀┼─┘                                       │                         │\n│ │  uri: github.com/some/where│ │                                         │                         │\n│ └────────────────────────────┘ │                                         │                         │\n└────────────────────────────────┘                                         └─────────────────────────┘\n```\n\n\nWhy?\n====\n\nOur concourse deployment was causing considerable load on our github enterprise appliance and we needed to increase the `check_every` properties on all our git resources and rely on [resource webhooks](https://concourse-ci.org/resources.html#resource-webhook-token) to propagte updates in a timely fashion.\n\nWe are also using a single repository in 300 resources across 70 pipelines and adding 300 webhooks to this github repository is unfeasable.\n\nHow?\n====\nThe webhook broadcaster periodically (`--refresh-interval`) fetches all pipelines via the concourse api and builds up a cache of all resources that have a `webhook_token` configured. When  a push event is received the broadcaster scans its local cache and calls the webhook url of all resources that reference this particular repository using the resources individual `webhook_token`.\n\nUsage\n======\n1. Start a webhook-broadcaster you need to provide the following configuration\n   * `--concourse-url` external url of your concourse deployment\n   * `--auth-user` concourse basic auth admin user. \n   * `--auth-password` concourse basic auth admin password\n2. Create a github webhook for push events pointing it to `http://webhook-broadcaster.somewhere:8080/github`\n3. Make sure resources of type `git` have a `webhook_token` configured\n\nCompatibility\n=============\n* webhook-broadcaster should work with concourse `\u003e=4.x`. There is a branch https://github.com/sapcc/webhook-broadcaster/tree/concourse-3.x that supports concourse `3.x`.\n* The broadcaster only supports github webhooks yet. Adding different types of webhooks, even for resources of different types should be simple (PRs welcome).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapcc%2Fwebhook-broadcaster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsapcc%2Fwebhook-broadcaster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsapcc%2Fwebhook-broadcaster/lists"}