What happens, step by step, between `git push` and the first step running?
AdvancedConceptWorkflow Anatomy & Execution Model
Answer
- GitHub emits a
pushevent and evaluates every workflow file at the pushed SHA. - For each workflow,
on.pushfilters (branches,tags,paths) are matched against the ref and the changed files (only the first 300 changed files are considered for path filters). - Matching workflows create a run; job-level
ifexpressions that only use available contexts are evaluated; jobs withoutneedsare queued. - Each queued job requests a runner matching
runs-on. Hosted: a VM is provisioned. Self-hosted: an idle runner long-polling the broker gets the job message. - The runner receives the job with a freshly minted
GITHUB_TOKEN, downloads every referenced action at its resolved ref, then runs the "Set up job" step and your steps in order, streaming logs back.
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