Skip to content

CICD-028 · Add a private tool directory to PATH ​

Encyclopedia · Variables, outputs and data flow · All snippets

Previous · CICD-027 · Next · CICD-029

1. Where it fits ​

  • Placement In a shell step before later steps invoke the installed executable.
  • Prerequisites GitHub Actions job or equivalent Gitea version with environment file support.
  • Platforms local-linux, github-actions, gitea-actions.
  • Parameters GITHUB_PATH, RUNNER_TEMP.

2. Copy the snippet ​

bash
mkdir -p "$RUNNER_TEMP/bin"
printf '%s\n' "$RUNNER_TEMP/bin" >> "$GITHUB_PATH"

3. How it works ​

mkdir creates a job-owned bin directory and GITHUB_PATH registers it for later steps. The current shell's PATH is unchanged unless it is also exported here.

4. Verify the result ​

Put a checked executable in this directory and use it only in later steps.

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