From e03fe7ebe4d9fab0220b220cc4c295cfca1ddde4 Mon Sep 17 00:00:00 2001 From: Hayden Spitzley Date: Thu, 30 May 2024 12:00:37 -0600 Subject: [PATCH] filter empties --- .github/workflows/argus-docker-build.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/argus-docker-build.yaml b/.github/workflows/argus-docker-build.yaml index 01f8b063..e428cd08 100644 --- a/.github/workflows/argus-docker-build.yaml +++ b/.github/workflows/argus-docker-build.yaml @@ -62,8 +62,8 @@ jobs: return regexPattern.test(text); } - const branches = `${{ inputs.branches }}`.split(',').map(b => b.trim()); - const branchesIgnore = `${{ inputs.branches_ignore }}`.split(',').map(b => b.trim()); + const branches = `${{ inputs.branches }}`.split(',').map(b => b.trim()).filter(b => b.length > 0); + const branchesIgnore = `${{ inputs.branches_ignore }}`.split(',').map(b => b.trim()).filter(b => b.length > 0); const branch = `${{ github.ref }}`.replace('refs/heads/', ''); const shouldRun = branches.some(b => wildcardMatch(branch, b)) && !branchesIgnore.some(b => wildcardMatch(branch, b)); @@ -78,14 +78,14 @@ jobs: uses: actions/github-script@v7 with: script: | - const filters = `${{ inputs.path_filters }}`.split(',').map(f => f.trim()); + const filters = `${{ inputs.path_filters }}`.split(',').map(f => f.trim()).filter(b => b.length > 0); const filtersStr = "run_on:\n" + filters.map(f => ` - '${f}'`).join('\n'); core.setOutput('filters', filtersStr); const images = JSON.parse(`${{ inputs.images }}`); core.setOutput('images', images); - const envs = `${{ inputs.envs }}`.split(',').map(env => env.trim()); + const envs = `${{ inputs.envs }}`.split(',').map(env => env.trim()).filter(b => b.length > 0); core.setOutput('envs', envs.join(' ')); - name: Check for matching file changes