Repository navigation
ci: notify webhook after image push - #5
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
New optional step in the
imagejob ofbuild.yml: right after a successful push to GHCR the workflow sends aPOSTtoWEBHOOK_URLwith anAuthorization: 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 reportssummary.updated > 0(or the HTTP status is not 200).if: env.WEBHOOK_URL != ''– runs without the repository secrets skip the step (thesecretscontext cannot be used inif).main, the weekly rebuild andworkflow_dispatch. The token is never logged.jqis preinstalled on GitHub-hosted runners.updated: 0and 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 URLWEBHOOK_TOKEN– sent asAuthorization: Bearer <token>README gains a short paragraph describing the optional webhook.