Fix invalid secrets context in test-linting workflow

The secrets context is not available in step-level if: conditions,
causing the workflow file to fail validation. Move the conditional
check into the shell script instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Julio Quinteros Pro 2026-03-01 16:54:53 -03:00
parent ac6e1d9fd1
commit b40b1e6a4b

View File

@ -97,9 +97,12 @@ jobs:
pytest tests/litellm/test_no_hardcoded_secrets.py -v
- name: Run ggshield secret scan
if: ${{ secrets.GITGUARDIAN_API_KEY != '' }}
env:
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}
run: |
pip install ggshield
ggshield secret scan repo .
if [ -n "$GITGUARDIAN_API_KEY" ]; then
pip install ggshield
ggshield secret scan repo .
else
echo "GITGUARDIAN_API_KEY not set, skipping ggshield scan"
fi