Skip to content

Commit eaadbd7

Browse files
committed
fix(reusable-zizmor): skip empty ZIZMOR_CONFIG variable
1 parent 8499a7f commit eaadbd7

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/reusable-zizmor.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,12 +380,14 @@ jobs:
380380
ZIZMOR_CACHE_DIR: ${{ runner.temp }}/.cache/zizmor
381381
shell: sh
382382
run: >-
383+
if [ -z "${ZIZMOR_CONFIG}" ]; then
384+
unset ZIZMOR_CONFIG
385+
fi
383386
uvx zizmor@"${ZIZMOR_VERSION}"
384387
--format sarif
385388
--min-severity "${MIN_SEVERITY}"
386389
--min-confidence "${MIN_CONFIDENCE}"
387390
--cache-dir "${ZIZMOR_CACHE_DIR}"
388-
${ZIZMOR_CONFIG:+--config "${ZIZMOR_CONFIG}"}
389391
${RUNNER_DEBUG:+"--verbose"}
390392
${ZIZMOR_EXTRA_ARGS:+${ZIZMOR_EXTRA_ARGS}}
391393
.
@@ -419,13 +421,15 @@ jobs:
419421
# don't fail the build if zizmor fails - we want to capture the output
420422
# and the exit code
421423
set +e
424+
if [ -z "${ZIZMOR_CONFIG}" ]; then
425+
unset ZIZMOR_CONFIG
426+
fi
422427
uvx zizmor@"${ZIZMOR_VERSION}" \
423428
--format plain \
424429
--min-severity "${MIN_SEVERITY}" \
425430
--min-confidence "${MIN_CONFIDENCE}" \
426431
--cache-dir "${ZIZMOR_CACHE_DIR}" \
427432
${RUNNER_DEBUG:+"--verbose"} \
428-
${ZIZMOR_CONFIG:+--config "${ZIZMOR_CONFIG}"} \
429433
${ZIZMOR_EXTRA_ARGS:+${ZIZMOR_EXTRA_ARGS}} \
430434
. \
431435
| tee -a "${GITHUB_OUTPUT}"

0 commit comments

Comments
 (0)