Skip to content

CICD-027 · Write a variable for later steps ​

Encyclopedia · Variables, outputs and data flow · All snippets

Previous · CICD-026 · Next · CICD-028

1. Where it fits ​

  • Placement In a shell step of a GitHub Actions or compatible Gitea Actions job.
  • Prerequisites GitHub Actions job or equivalent Gitea version with environment file support.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters GITHUB_ENV.

2. Copy the snippet ​

bash
printf 'BUILD_MODE=ci\n' >> "$GITHUB_ENV"

3. How it works ​

The runner reads the GITHUB_ENV command file when this step ends and exports the submitted key for subsequent steps in the same job.

4. Verify the result ​

Observe BUILD_MODE in a later step in the same job.

Validation syntax-validated (Bash parse). Status definitions.