From efebb14a8aeb8c521f8f98f78457260ec1353c60 Mon Sep 17 00:00:00 2001 From: bijantavakoli <167471582+bijantavakoli@users.noreply.github.com> Date: Mon, 15 Dec 2025 19:34:13 -0500 Subject: [PATCH] Fix: Prevent partial directory matching in change detection Fixes a bug where directory names that are substrings of others (e.g., shopify_general vs shopify_general_v2) caused false positive builds. The logic has been updated to strictly enforce directory boundaries (using path.sep) so that changes in a _v2 folder do not trigger builds for the base folder. --- src/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 741f5e2..a0d43fa 100644 --- a/src/index.js +++ b/src/index.js @@ -105,7 +105,9 @@ const main = async () => { const pipelines = matches .filter((file) => { const dirname = path.dirname(path.relative(root, file)); - return includesBy(relevantChanges, (change) => change.startsWith(dirname)); + return includesBy(relevantChanges, (change) => { + return change === dirname || change.startsWith(dirname + path.sep); + }); }) .map(buildThenDeploy(registry, shouldDeploy, parsedImageTags));