Consumes GitHub webhooks and publishes them to a GCP Pub/Sub topic.
The published payload can optionally be compressed by setting PAYLOAD_COMPRESSION to gzip:<level> or zstd:<level>. If PAYLOAD_COMPRESSION_ATTRIBUTE is also set, the published Pub/Sub message includes that attribute with the algorithm name only, such as gzip or zstd.
Full documentation is available in the docs/ folder:
- Configuration – environment variables and Docker usage
- Pub/Sub Attributes – message attribute contract
- Architecture – design, request flow, and error handling
Run with Docker:
docker run \
-e PUBSUB_PROJECT_ID=my-gcp-project \
-e PUBSUB_TOPIC_ID=github-webhooks \
-e WEBHOOK_SECRETS=my-secret \
-e PAYLOAD_COMPRESSION=gzip:6 \
-e PAYLOAD_COMPRESSION_ATTRIBUTE=compression \
-p 8080:8080 \
ghook2pubsubThen configure your GitHub webhook to point at http://<host>:8080/webhook.
This project is licensed under the MIT License.