Skip to content
Latchkey

What Is RUNNER_TEMP?

RUNNER_TEMP is the path to a temporary directory that is emptied at the start of every job.

RUNNER_TEMP is the right place for scratch files: it is writable, guaranteed empty, and cleaned between jobs, which avoids leftover state on self-hosted runners.

Example

Write a scratch file safely.

shell
echo "data" > "${RUNNER_TEMP}/scratch.txt"

Key takeaways

  • RUNNER_TEMP is a clean scratch directory.
  • Emptied at the start of each job.
  • Safer than /tmp on self-hosted runners.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →