Skip to content

ci: notify webhook after image push - #5

Merged
skoelle merged 1 commit into
mainfrom
ci/webhook-notify
Oct 10, 2026
Merged

skoelle merged 1 commit into
mainfrom
ci/webhook-notify

Conversation

@skoelle

@skoelle skoelle commented Oct 10, 2026

Copy link
Copy Markdown
Owner

What

New optional step in the image job of build.yml: right after a successful push to GHCR the workflow sends a POST to WEBHOOK_URL with an Authorization: Bearer <WEBHOOK_TOKEN> header. The receiver updates the local image synchronously (pull + restart), so the step waits up to 10 minutes (--max-time 600, --connect-timeout 15), logs the JSON reply and evaluates it: the run fails unless the reply reports summary.updated > 0 (or the HTTP status is not 200).

  • Guarded by if: env.WEBHOOK_URL != '' – runs without the repository secrets skip the step (the secrets context cannot be used in if).
  • Fires on every successful image push: pushes to main, the weekly rebuild and workflow_dispatch. The token is never logged.
  • jq is preinstalled on GitHub-hosted runners.
  • Known caveat (accepted): a rebuild that pushes an unchanged digest (e.g. a docs-only commit with cache hits) makes the receiver answer updated: 0 and the step go red on purpose.

Setup (once per repo, not part of this PR)

Repository secrets under Settings → Secrets and variables → Actions:

  • WEBHOOK_URL – endpoint URL
  • WEBHOOK_TOKEN – sent as Authorization: Bearer <token>

README gains a short paragraph describing the optional webhook.

New optional step in the image job: POST to WEBHOOK_URL with an
Authorization: Bearer WEBHOOK_TOKEN header right after a successful
push to GHCR. The receiver updates the local image synchronously, so
the step waits up to 10 minutes and reads the JSON reply - it fails
unless summary.updated > 0 (or the HTTP status is not 200). Guarded by
env.WEBHOOK_URL so runs without the secrets skip the step.
@skoelle
skoelle merged commit 948e680 into main Oct 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant