Skip to content

Commit a6fd7c6

Browse files
author
Nico Thomaier
committed
Enhance pytest step in CI workflow to skip tests if secrets are missing
1 parent 114685f commit a6fd7c6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/workflows/python-app.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,13 @@ jobs:
6161
python -m pip install --upgrade pip
6262
pip install -r requirements.txt
6363
pip install -r requirements-dev.txt
64-
- name: Test with pytest
64+
- name: Test with pytest (skip entirely if secrets missing)
6565
env:
6666
office365_python_sdk_securevars: ${{ secrets.OFFICE365_PYTHON_SDK_SECUREVARS }}
6767
run: |
68-
echo "${{env.office365_python_sdk_securevars}}"
69-
pytest
68+
if [ -z "${{env.office365_python_sdk_securevars}}" ]; then \
69+
echo "No secrets available; skipping pytest"; \
70+
exit 0; \
71+
else \
72+
pytest; \
73+
fi

0 commit comments

Comments
 (0)