Diffinery

codician/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

Live test: point the push webhook at a public host, and check one to Diffinery itself is refused (#109)

#96 refuses webhooks to Diffinery's own host, so the live test's webhook to /healthz got a 422
and every sync's live test failed from then on.


Claude-Session: https://claude.ai/code/session_016yhgAu6oKfqes812Yd4qjo

Co-authored-by: Claude <noreply@anthropic.com>
Canberk Demirci authored · GitHub committed signed1 parent ebac8b0commit 4cfb3c2a46020fea1dd0e1d08bc69140deb91080Browse files
1 file changed+4−1
modified.github/workflows/live-test.yml+4−1View file
@@ -158,7 +158,10 @@
158158 set -euo pipefail
159159 api() { curl -fsS -X "$1" "$DIFFINERY/api/v3$2" -H "Authorization: Bearer $TOKEN" -H "content-type: application/json" ${3:+--data "$3"}; }
160160 api POST /user/repos "{\"name\":\"$REPO\",\"private\":true}" >/dev/null
161- api POST "/repos/$OWNER/$REPO/hooks" "{\"config\":{\"url\":\"$DIFFINERY/healthz\"},\"events\":[\"push\"]}" >/dev/null
161+ # Webhooks may only reach public hosts other than Diffinery itself; the push's delivery goes to example.com.
162+ code=$(curl -sS -o /dev/null -w '%{http_code}' -X POST "$DIFFINERY/api/v3/repos/$OWNER/$REPO/hooks" -H "Authorization: Bearer $TOKEN" -H "content-type: application/json" --data "{\"config\":{\"url\":\"$DIFFINERY/healthz\"},\"events\":[\"push\"]}")
163+ [ "$code" = 422 ] || { echo "::error::a webhook to Diffinery itself answered $code, not 422"; exit 1; }
164+ api POST "/repos/$OWNER/$REPO/hooks" "{\"config\":{\"url\":\"https://example.com/diffinery-live-test\"},\"events\":[\"push\"]}" >/dev/null
162165 echo "created $OWNER/$REPO"
163166
164167 - name: Push workflows and an LFS file