Skip to content

fix(webhooks): skip GitHub push events that delete a branch or tag - #5954

Open
AryaKesharwani wants to merge 1 commit into
Dokploy:canaryfrom
AryaKesharwani:fix/github-webhook-ignore-deleted-ref
Open

AryaKesharwani wants to merge 1 commit into
Dokploy:canaryfrom
AryaKesharwani:fix/github-webhook-ignore-deleted-ref

Conversation

@AryaKesharwani

@AryaKesharwani AryaKesharwani commented Nov 10, 2026 •

Copy link
Copy Markdown

What is this PR about?

Deleting a branch or tag on GitHub sends a push webhook with "deleted": true (and after set to all zeros). pages/api/deploy/github.ts doesn't check for it, so:

  • deleting a branch queues a deploy for every application and compose with auto-deploy on that branch (shouldDeploy returns true when no watch paths are set), and the deploy then fails because the branch no longer exists;
  • deleting a tag runs the tag path and queues a deploy titled Tag created: <tag> for apps that deploy on tags, which fails the same way.

The handler now answers 200 with "Deployment skipped: ref was deleted" for push events where deleted is true, before the tag and branch handling.

Checklist

Before submitting this PR, please make sure that:

  • You created a dedicated branch based on the canary branch.
  • You have read the suggestions in the CONTRIBUTING.md file https://github.com/Dokploy/dokploy/blob/canary/CONTRIBUTING.md#pull-request
  • You have tested this PR in your local instance. If you have not tested it yet, please do so before submitting. This helps avoid wasting maintainers' time reviewing code that has not been verified by you.

Issues related (if applicable)

None open for this case.

Screenshots (if applicable)

Added ignores push events that delete a branch to __test__/deploy/github-webhook-handler.test.ts. It fails on canary (a deploy is queued) and passes with the fix; the file passes 9/9.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Skips GitHub push events that delete a branch or tag.

  • Deleted branch and tag pushes now skip deployment.

Reviews (1) · Last reviewed commit: "fix(webhooks): skip GitHub push events t..." · Reviewed by Greptile

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.

1 participant