Should you use `ubuntu-latest` or `ubuntu-24.04`?
BeginnerConceptWorkflow Anatomy & Execution Model
Answer
In production we pin ubuntu-24.04. -latest labels migrate to a new OS version on GitHub's schedule (ubuntu-latest moved from 22.04 to 24.04 in late 2024), which silently changes tool versions, default Python, and package names, and breaks builds on a day nobody touched the repo. Pin the image, and upgrade deliberately with a PR. Also note old images are retired (ubuntu-20.04 was removed in 2025), and jobs targeting retired labels fail.
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?BeginnerWhat runner images and architectures can you choose from?Intermediate