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.
More on Workflow Anatomy & Execution Model
Define workflow, run, job, step, action and runner in one line each.BeginnerWhat is the minimum valid workflow file?BeginnerWhere must workflow files live, and does the file extension matter?BeginnerWhich version of the workflow file does GitHub use for a given run?IntermediateWhat does a GitHub-hosted runner give you at the start of a job?BeginnerShould you use `ubuntu-latest` or `ubuntu-24.04`?Beginner