Skip to content

[Bug]: GitHub push watch paths can trigger from transient commit changesΒ #10937

Description

@wottpal

Description

For GitHub App deployments, watch-path filtering currently unions the added, removed, and modified arrays from every commit in a push. In a multi-commit push containing merge commits, an intermediate commit can report a path relative to its first parent even when that path is unchanged between the push event's before and after SHAs.

This can trigger deployments for applications whose watched files did not change in the final branch update.

Steps to reproduce

  1. Configure two applications from one repository:
    • app A watches packages/payments/**
    • app B watches apps/dashboard/**
  2. Create a feature branch from an older base.
  3. Merge the integration branch into the feature branch so the merge commit reports packages/payments/config.yml relative to its first parent.
  4. Merge or push the integration branch to the deployment branch after that file is already present there.
  5. Confirm git diff <before>..<after> -- packages/payments is empty.
  6. Observe that app A still deploys because the webhook's per-commit file union contains the transient path.

Expected behavior

Watch paths should be evaluated against the net files changed between the push payload's before and after SHAs.

Actual behavior

Any path mentioned by any commit in the pushed history can trigger a deployment, including paths that are unchanged in the final branch state.

Root cause

The GitHub push webhook handler builds its changed-file list from commits.*.added, commits.*.removed, and commits.*.modified. Coolify already has a GitHub Compare helper for before...after, used by pull-request synchronization, which provides the correct net file set.

Version

4.1.2 and current next

Additional information

A safe implementation can use the Compare API as the authoritative source when available and retain the webhook arrays as a fallback for branch creation, branch deletion, or API failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    πŸ› Possible BugReported issues that need to be reproduced by the team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions