Skip to content

fix(deploy): skip untagged GHCR package events in docker webhook - #5682

Open
ituzov wants to merge 2 commits into
Dokploy:canaryfrom
ituzov:fix/ignore-untagged-registry-package
Open

ituzov wants to merge 2 commits into
Dokploy:canaryfrom
ituzov:fix/ignore-untagged-registry-package

Conversation

@ituzov

@ituzov ituzov commented Oct 15, 2026 •

Copy link
Copy Markdown

What is this PR about?

GHCR sends a registry_package event for every manifest of a push, not only for tags. A push made with docker/github-builder gives 7 events: the index, per-platform manifests and attestations without a tag, then latest and sha-<commit>. For the untagged ones extractImageTagFromRequest returns null, the tag check in the docker branch was wrapped in if (webhookDockerTag), so each of them deployed the configured image. One push gave 5 deployments instead of 1.

Now a registry_package event without a tag gets 200 {"message":"Untagged image version, skipping deployment"} and no deployment. Nothing else changes:

  • events with the configured tag deploy as before;
  • events with another tag (sha-…, sha256-… signatures) still get 301;
  • a request without image info (a plain POST from CI) still deploys the configured image, it never enters this branch.

Tests: __test__/deploy/refresh-token-handler.test.ts calls the handler with mocked db and queue and covers untagged manifest and index events, the configured tag, other tags, a plain POST and a Docker Hub webhook. I checked that the tests fail on canary and when the new branch is removed or changed (for example, without the return the handler answered twice and the tests now catch that).

How I tested it on a local instance: I saved the 7 real deliveries from the webhook in #5681 and replayed them with the same headers against pnpm run dokploy:dev, once on canary and once on this branch.

Delivery canary this PR
4 × untagged (manifest, index) 200, deployed 200, skipped
latest 200, deployed 200, deployed
sha-8903ce2, sha256-… 301 301
Deployments created 5 1

The deployments show Error in the screenshots because the local instance has no Docker Swarm. Only the number of deployments matters here.

Checklist

Before submitting this PR, please make sure that:

Issues related (if applicable)

closes #5681

Screenshots (if applicable)

dokploy-5681-3-local-before-fix dokploy-5681-4-local-after-fix

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Stops untagged GHCR deliveries from starting extra deployments.

  • Untagged GHCR events stop before starting Docker deployments.

Reviews (2) · Last reviewed commit: "test(deploy): cover docker webhook tag h..." · Reviewed by Greptile

GHCR sends a registry_package event for every manifest of a push,
including untagged per-platform manifests and attestations. Those had
no tag to compare, so each one triggered a deployment of the configured
image. Answer 200 and skip them instead.

Refs Dokploy#5681
@ituzov
ituzov requested a review from Siumauricio as a code owner October 15, 2026 11:14

This branch has not been deployed

No deployments
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.

Docker app redeploys on untagged registry_package events from GHCR

1 participant