CICD-025 · Pass a file path through a step variable
Encyclopedia · Variables, outputs and data flow · All snippets
Previous · CICD-024 · Next · CICD-026
1. Where it fits
- Placement .github/workflows/ci.yml, under a job's steps.
- Prerequisites GitHub Actions job or equivalent Gitea version with environment file support.
- Platforms github-actions, gitea-actions.
- Parameters
REPORT.
2. Copy the snippet
yaml
env:
REPORT: reports/test.xml
run: test -s "$REPORT"3. How it works
The CI runner exports REPORT only for this step. The shell expands the quoted variable as one path, and test -s returns success only when that path contains bytes.
4. Verify the result
Set the file from the producer and prove the consumer fails if it is absent.
Validation syntax-validated (YAML parse). Status definitions.