feat: workflow filter assets by upload path (#30000)

Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com>
This commit is contained in:
Ben Beckford 2026-07-17 02:46:48 -07:00 committed by GitHub
parent f2c00c107d
commit 12fc8bac18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View file

@ -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"]

View file

@ -54,11 +54,11 @@ const methods = wrapper<Manifest>({
},
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();