OctoPing
This repository contains a simple Dockerized service that polls the GitHub Notifications API and relays new personal notifications to a webhook URL.
Install
Deploy with the following Docker command or use the provided Docker Compose file.
docker run -d \
--name octoping \
-e GITHUB_TOKEN=ghp_xxxxxxxxx \
-e WEBHOOK_URL=https://example.com/webhook \
-e POLL_INTERVAL=60 \
-v ./data:/data \
ghcr.io/kieranlane/octoping:latest
Environment Variables
GITHUB_TOKEN: GitHub token withnotificationsscope.WEBHOOK_URL: Your destination webhook URL.POLL_INTERVAL: (Optional) Polling interval in seconds, default60.STATE_FILE: (Optional) Path to store last seen timestamp, default/data/state.json.
Build
- Build the Docker image:
docker build -t octoping . - Run the container:
docker run -d \ --name octoping \ -e GITHUB_TOKEN=ghp_xxxxxxxxx \ -e WEBHOOK_URL=https://example.com/webhook \ -e POLL_INTERVAL=60 \ -v ./data:/data \ octoping
Usage with Hookshot
You can setup Matrix Hookshot to recieve the webhooks to create a GitHub notification room for you using the below steps:
- Setup a new Inbound (Generic) Webhook in your desired notification room.
- Enable Transformation JavaScript
- Enable Respond after function completes
-
Set the transformation to:
result = { version: "v2", plain: `${data.markdown}`, msgtype: "m.text" }