A lightweight Go service that bridges Forgejo webhooks to the Mogenius Renovate Operator in Kubernetes. https://opencommit.eu/opencommit/webhook-bridge
  • Go 98.7%
  • Dockerfile 1.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Patchbot 03487717b9
All checks were successful
ci / lint (pull_request) Successful in 34s
ci / test (pull_request) Successful in 25s
ci / lint (push) Successful in 2m17s
ci / test (push) Successful in 37s
chore(deps): update module k8s.io/client-go to v0.37.0
2026-08-26 21:46:47 +00:00
.forgejo/workflows chore(deps): update actions/checkout action to v7 2026-08-26 16:38:37 +00:00
internal/renovateapi initial commit 2026-08-26 15:47:42 +02:00
.dockerignore ci: redo workflows 2026-08-26 16:24:41 +02:00
.golangci.yml ci: fix linter config 2026-08-26 16:01:08 +02:00
Dockerfile chore(deps): update golang docker tag to v1.27 2026-08-26 15:22:19 +00:00
go.mod chore(deps): update module k8s.io/client-go to v0.37.0 2026-08-26 21:46:47 +00:00
go.sum chore(deps): update module k8s.io/client-go to v0.37.0 2026-08-26 21:46:47 +00:00
handler.go initial commit 2026-08-26 15:47:42 +02:00
handler_test.go initial commit 2026-08-26 15:47:42 +02:00
LICENSE docs: add license and readme files 2026-08-26 16:01:23 +02:00
main.go initial commit 2026-08-26 15:47:42 +02:00
README.md docs: add license and readme files 2026-08-26 16:01:23 +02:00
renovate.json Add renovate.json 2026-08-26 14:49:37 +00:00
repos.go initial commit 2026-08-26 15:47:42 +02:00
repos_test.go initial commit 2026-08-26 15:47:42 +02:00

webhook-bridge

A lightweight Go service that bridges Forgejo webhooks to the Mogenius Renovate Operator in Kubernetes.

Instead of configuring per-repository webhooks in Forgejo, a single system-wide webhook points at this bridge. It filters events and forwards only those for repositories managed by Renovate.

How It Works

  1. Connects to the Kubernetes API and watches RenovateJob custom resources in the renovate-operator namespace.
  2. Maintains an in-memory cache of onboarded repositories (jobs with spec.webhook.enabled: true).
  3. Receives Forgejo webhook events at /webhook, validates the bearer token, and checks whether the repository is onboarded.
  4. Forwards matching events (with original headers and body) to the Renovate Operator's webhook endpoint.

Configuration

Variable Required Default Description
WEBHOOK_TOKEN_SECRET Yes Bearer token for authenticating incoming webhook requests
LISTEN_ADDR No :8080 Address and port for the HTTP server
OPERATOR_WEBHOOK_URL No http://renovate-operator.renovate-operator.svc.cluster.local:8080/webhook/v1/forgejo Renovate Operator webhook endpoint

Endpoints

Method Path Description
POST /webhook Receives Forgejo webhook events
GET /healthz Health check

Building

go build -o webhook-bridge .

Docker

docker build -t webhook-bridge .
docker run -e WEBHOOK_TOKEN_SECRET=my-secret webhook-bridge

The Dockerfile produces a minimal distroless image running as non-root.

Prerequisites

  • A Kubernetes cluster with the Mogenius Renovate Operator installed.
  • RenovateJob custom resources with spec.webhook.enabled: true in the renovate-operator namespace.
  • Forgejo configured with a system-wide webhook pointing at this service's /webhook path.

Running Tests

go test ./... -v

License

This project is licensed under the Mozilla Public License 2.0.