Skip to content

fix(webhook): include added and removed files in watchPaths validation#4772

Open
rifatdinc wants to merge 1 commit into
Dokploy:canaryfrom
rifatdinc:fix-watch-paths-added-removed-files
Open

fix(webhook): include added and removed files in watchPaths validation#4772
rifatdinc wants to merge 1 commit into
Dokploy:canaryfrom
rifatdinc:fix-watch-paths-added-removed-files

Conversation

@rifatdinc

Copy link
Copy Markdown

Description

Currently, Dokploy only extracts modified files from Git webhook payloads to validate watchPaths:

const normalizedCommits = req.body?.commits?.flatMap((commit: any) => commit.modified);

This causes auto-deployments to not trigger when a push contains only new files (added) or deleted files (removed), since normalizedCommits evaluates to an empty array [] and micromatch fails to match.

Solution

This PR updates the webhook parsing logic across all git providers and platforms (application & compose) to aggregate added, modified, and removed files:

const normalizedCommits = req.body?.commits?.flatMap((commit: any) => [
	...(commit.added || []),
	...(commit.modified || []),
	...(commit.removed || []),
]);

This ensures auto-deployments trigger correctly for file creations, deletions, and moves.

Currently, Dokploy only extracts modified files from webhook payloads.
This causes watchPaths to fail matching commits that only add or remove files (such as adding new routes or deleting files), preventing auto-deployments.

This commit updates the commit parsing logic to aggregate added, modified, and removed files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants