Interview Prep/GitHub Actions/Workflow Anatomy & Execution Model

What are the main environment variables GitHub sets on the runner?

BeginnerConceptWorkflow Anatomy & Execution Model
Answer

GITHUB_SHA, GITHUB_REF (refs/heads/main), GITHUB_REF_NAME (main), GITHUB_HEAD_REF and GITHUB_BASE_REF (PRs only), GITHUB_REPOSITORY, GITHUB_ACTOR, GITHUB_EVENT_NAME, GITHUB_EVENT_PATH (full JSON payload), GITHUB_WORKSPACE, GITHUB_RUN_ID, GITHUB_RUN_NUMBER, GITHUB_RUN_ATTEMPT, RUNNER_OS, RUNNER_ARCH, RUNNER_TEMP, CI=true, plus the file-command paths GITHUB_OUTPUT, GITHUB_ENV, GITHUB_PATH, GITHUB_STEP_SUMMARY. These are the runtime twins of the github and runner contexts.

All GitHub Actions questions Roadmap: GitHub Actions

More on Workflow Anatomy & Execution Model