What is the difference between `runs-on: ubuntu-latest` and a pinned version like `ubuntu-24.04`?
BeginnerConceptGitHub Actions
Answer
ubuntu-latest is an alias GitHub moves to the newest stable Ubuntu image over time, which can suddenly change toolchains and break builds. A pinned label (ubuntu-24.04) stays on that image until it is deprecated, giving predictable upgrades that you control. For stable CI, pin and bump deliberately.
More on GitHub Actions
What are workflows, jobs, steps and actions in GitHub Actions?BeginnerWhat events can trigger a workflow?BeginnerWhat is the difference between `pull_request` and `pull_request_target`?AdvancedWhat is a runner, and how do GitHub-hosted and self-hosted runners differ?BeginnerHow do you pass data between steps and between jobs?IntermediateHow does a build matrix work?Intermediate