No description
  • Go 97.1%
  • Makefile 2.9%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Adam Macumber 37b600e442 fix: match Forgejo's snake_case JSON field names in templates
Forgejo webhook payloads use lowercase/snake_case keys ("ref",
"repository", "full_name", "total_commits", etc.), not PascalCase.
The default templates referenced fields like .Repository.FullName and
.Ref, which failed at render time with 'invalid value; expected string'
because those keys don't exist in the unmarshalled map.

Changed all template field references to match Forgejo's actual format:
- repository.full_name, ref, pusher.username, total_commits,
  commits[].id, commits[].message, sender.username, etc.
- .pusher.username instead of .pusher.full_name (full_name is often
  empty for token-auth pushes)

Added tests using real Forgejo payload data and a token-auth edge case
where pusher.full_name is empty.
2026-08-28 10:58:23 -04:00
docs/superpowers docs: add implementation plan; clarify custom template funcs in spec 2026-08-28 09:58:15 -04:00
.gitignore fix: align deps and build image for gotify/server v3.1.0 2026-08-28 10:31:28 -04:00
config.go chore: gofmt 2026-08-28 10:19:20 -04:00
config_test.go chore: gofmt 2026-08-28 10:19:20 -04:00
display_test.go fix: fail cleanly when enabled before config is set 2026-08-28 10:49:07 -04:00
go.mod fix: align deps and build image for gotify/server v3.1.0 2026-08-28 10:31:28 -04:00
go.sum fix: align deps and build image for gotify/server v3.1.0 2026-08-28 10:31:28 -04:00
Makefile fix: align deps and build image for gotify/server v3.1.0 2026-08-28 10:31:28 -04:00
plugin.go fix: fail cleanly when enabled before config is set 2026-08-28 10:49:07 -04:00
README.md fix: fail cleanly when enabled before config is set 2026-08-28 10:49:07 -04:00
render.go chore: gofmt 2026-08-28 10:19:20 -04:00
render_test.go fix: match Forgejo's snake_case JSON field names in templates 2026-08-28 10:58:23 -04:00
templates.go fix: match Forgejo's snake_case JSON field names in templates 2026-08-28 10:58:23 -04:00
templates_test.go chore: gofmt 2026-08-28 10:19:20 -04:00
webhook.go fix: send empty string for whitespace-only rendered body 2026-08-28 10:33:11 -04:00
webhook_test.go fix: match Forgejo's snake_case JSON field names in templates 2026-08-28 10:58:23 -04:00

gotify-forgejo

A Gotify plugin that receives Forgejo webhook notifications and forwards them as Gotify messages with per-event-type templates and priorities.

Features

  • All Forgejo webhook events supported (push, pull_request, issues, releases, etc.)
  • HMAC-SHA256 signature validation
  • Per-event-type Go templates for title and body
  • Per-event-type notification priority
  • YAML configuration via the Gotify WebUI

Building

Requires Docker. Build for Gotify v3.1.0:

make build

The resulting gotify-forgejo-linux-amd64-for-gotify-v3.1.0.so goes in Gotify's plugin directory.

Setup

  1. Copy the .so into your Gotify plugin directory and restart Gotify.
  2. Set the secret in the plugin config.
  3. Enable the plugin for your user in the WebUI.
  4. Point your Forgejo webhook at the URL shown on the plugin page.

Note: the secret is required. The plugin cannot be enabled until a non-empty secret is saved — enabling before configuring it returns an error.