Interview Prep/CI/CD/GitHub Actions Failures

Environment variable set in one step is missing in the next.

BeginnerTroubleshootingGitHub Actions Failures
Answer

Likely causes → export VAR=x only affects its own step's shell.

Diagnose → Print env in the next step.

Fix → Append to the file: echo "VAR=x" >> "$GITHUB_ENV".

Prevent → Use step outputs for typed data and GITHUB_ENV for env vars.

All CI/CD questions

More on GitHub Actions Failures