diff --git a/templates/gitlab-ci-python.yml b/templates/gitlab-ci-python.yml index 9a5759ab37b42a2fc842bff9ceede5c77660d428..96783a02cbc5898b0ae17954dd30beb608342d64 100644 --- a/templates/gitlab-ci-python.yml +++ b/templates/gitlab-ci-python.yml @@ -1209,7 +1209,7 @@ py-trivy: log_warn "The ./requirements.txt file does not match the ./reports/requirements.txt file generated via pip freeze. Make sure to include all dependencies with pinned versions in ./requirements.txt and re-commit the file." fi fi - if [ $($python_trivy fs ${PYTHON_TRIVY_ARGS} --format table --exit-code 0 ./reports/ | grep -c "Number of language-specific files: 0") -eq 1 ]; then + if [ $($python_trivy fs ${PYTHON_TRIVY_ARGS} --format table --exit-code 0 ./reports/ 2>&1 | grep -ic "Number of language-specific files[^0-9]*0$" ) -eq 1 ]; then log_error "Could not find a file listing all dependencies with their versions." exit 1 fi