Repository navigation
Conversation
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
This branch has not been deployed
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 is this PR about?
GHCR sends a
registry_packageevent for every manifest of a push, not only for tags. A push made withdocker/github-buildergives 7 events: the index, per-platform manifests and attestations without a tag, thenlatestandsha-<commit>. For the untagged onesextractImageTagFromRequestreturnsnull, the tag check in the docker branch was wrapped inif (webhookDockerTag), so each of them deployed the configured image. One push gave 5 deployments instead of 1.Now a
registry_packageevent without a tag gets200 {"message":"Untagged image version, skipping deployment"}and no deployment. Nothing else changes:sha-…,sha256-…signatures) still get 301;POSTfrom CI) still deploys the configured image, it never enters this branch.Tests:
__test__/deploy/refresh-token-handler.test.tscalls the handler with mocked db and queue and covers untagged manifest and index events, the configured tag, other tags, a plainPOSTand a Docker Hub webhook. I checked that the tests fail oncanaryand when the new branch is removed or changed (for example, without thereturnthe 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 oncanaryand once on this branch.canarylatestsha-8903ce2,sha256-…The deployments show
Errorin 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:
canarybranch.Issues related (if applicable)
closes #5681
Screenshots (if applicable)


Confidence Score: 5/5
The PR appears safe to merge.Summary
Stops untagged GHCR deliveries from starting extra deployments.
Reviews (2) · Last reviewed commit: "test(deploy): cover docker webhook tag h..." · Reviewed by Greptile