-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Compose GitHub auto-deploy webhook crashes when Watch Paths are enabled and commits have missing modified entries #4081
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
To Reproduce
- Create a Compose service using the GitHub provider.
- Enable
Auto Deploy. - Configure at least one
Watch Pathsentry. - Push a commit where the GitHub webhook payload has missing or partial changed-file arrays in
commits.- for example,
modifiedis missing - or the only paths are present in
added/removed
- for example,
- Let GitHub call the Dokploy compose webhook.
Current vs. Expected behavior
Current behavior:
- the webhook reaches Dokploy
- the compose deploy endpoint crashes before enqueueing the deployment
- auto-deploy does not happen
- server logs show
TypeError: Expected input to be a string
Expected behavior:
- Dokploy should not throw
- missing or partial changed-file arrays should be handled safely
- watch path matching should either correctly evaluate the changed files or return "no match" without crashing
Provide environment information
Operating System:
OS: Ubuntu 24.04.4 LTS
Arch: x86_64
Dokploy version: v0.28.8
VPS Provider: Hetzner
What applications/services are you trying to deploy?
Docker Compose service backed by a GitHub repo with Auto Deploy + Watch Paths enabledWhich area(s) are affected? (Select all that apply)
Docker Compose
Are you deploying the applications where Dokploy is installed or on a remote server?
Same server where Dokploy is installed
Additional context
The crash happens in the compose webhook path, not in GitHub delivery itself.
Observed server log:
TypeError: Expected input to be a string
at ...
at ... /api/deploy/compose/[refreshToken].js
The current compose webhook handler builds changed files only from commit.modified and passes that directly into watch path matching.
Relevant code paths:
apps/dokploy/pages/api/deploy/compose/[refreshToken].tsapps/dokploy/pages/api/deploy/[refreshToken].tsapps/dokploy/pages/api/deploy/github.tspackages/server/src/utils/watch-paths/should-deploy.ts
Current shape:
const normalizedCommits = req.body?.commits?.flatMap(
(commit: any) => commit.modified,
);
const shouldDeployPaths = shouldDeploy(
composeResult.watchPaths,
normalizedCommits,
);And:
export const shouldDeploy = (
watchPaths: string[] | null,
modifiedFiles: string[],
): boolean => {
if (!watchPaths || watchPaths?.length === 0) return true;
return micromatch.some(modifiedFiles, watchPaths);
};This throws when modifiedFiles is undefined or contains nullish values.
I reproduced the crash locally with:
shouldDeploy(["steam/**"], undefined as any)
shouldDeploy(["steam/**"], [undefined] as any)Both throw:
TypeError: Expected input to be a string
I also verified that webhook payload normalization is incomplete today because it ignores added and removed paths and only reads modified.
Will you send a PR to fix it?
Yes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working