From 12fc8bac183f40bc7b5e0c7837545edfd8d74caf Mon Sep 17 00:00:00 2001 From: Ben Beckford Date: Fri, 17 Jul 2026 02:46:48 -0700 Subject: [PATCH] feat: workflow filter assets by upload path (#30000) Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com> --- packages/plugin-core/manifest.json | 6 ++++++ packages/plugin-core/src/index.ts | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/plugin-core/manifest.json b/packages/plugin-core/manifest.json index 66a12c36f2..d55ad43e70 100644 --- a/packages/plugin-core/manifest.json +++ b/packages/plugin-core/manifest.json @@ -103,6 +103,12 @@ "default": false, "title": "Case sensitive", "description": "Whether matching should be case-sensitive" + }, + "usePath": { + "type": "boolean", + "default": false, + "title": "Use path", + "description": "Match the full path on the server instead of the original filename" } }, "required": ["pattern"] diff --git a/packages/plugin-core/src/index.ts b/packages/plugin-core/src/index.ts index 5dc358a2f0..d412ad7708 100644 --- a/packages/plugin-core/src/index.ts +++ b/packages/plugin-core/src/index.ts @@ -54,11 +54,11 @@ const methods = wrapper({ }, assetFileFilter: ({ data, config }) => { - const { pattern, matchType = 'contains', caseSensitive = false } = config; + const { pattern, matchType = 'contains', caseSensitive = false, usePath = false } = config; const { asset } = data; - const fileName = asset.originalFileName || ''; + const fileName = usePath ? asset.originalPath : asset.originalFileName; const searchName = caseSensitive ? fileName : fileName.toLowerCase(); const searchPattern = caseSensitive ? pattern : pattern.toLowerCase();