When a job uses container.image, how do steps typically access the repository files checked out by actions/checkout?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Actions mounts the job workspace into the container so checkout and build tools see your code. Containers are not blind empty jails by default, nor do you SSH to the API for source.
Full explanation below image
Full Explanation
For container jobs, GitHub mounts the workspace so actions/checkout and subsequent steps operate on the same project files inside the container filesystem view. GITHUB_WORKSPACE points at that working tree. Claiming checkout cannot work with containers is false for normal setups. Artifacts and workflow_run are separate distribution mechanisms, not the default way to see your own repo inside the job container. SSH to api.github.com is not how checkout mounts code. Volume mount nuances can appear with custom working directories, Docker-in-Docker, or file ownership/UID mismatches—teams sometimes chown or run as matching users. Prefer official setup actions compatible with containers when installing toolchains.