Which statement correctly contrasts RUNNER_TEMP and GITHUB_WORKSPACE on a GitHub-hosted runner?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Workspace is your repo checkout; temp is ephemeral scratch space that can be safer for intermediate files you do not want to commit or upload accidentally.
Full explanation below image
Full Explanation
GITHUB_WORKSPACE points at the directory where actions/checkout places the repository (by default the workspace root for the job). RUNNER_TEMP is a temporary directory on the runner intended for intermediate files; it is cleaned up as part of the runner's lifecycle and should not be treated as durable storage. They are distinct paths. RUNNER_TEMP is not a secrets store — secrets come from the secrets context and are masked in logs. GITHUB_WORKSPACE is available on both hosted and self-hosted runners when the job has a workspace. Related variables include RUNNER_TOOL_CACHE for tool install caches used by setup-* actions. Prefer writing disposable build scratch under RUNNER_TEMP when you want isolation from the repository tree.