What is the minimum valid workflow file?
BeginnerConceptWorkflow Anatomy & Execution Model
Answer
It needs on and at least one job with runs-on and steps. name is optional (the file path is shown instead).
on: push
jobs:
hello:
runs-on: ubuntu-24.04
steps:
- run: echo "Hello from ${{ github.repository }}"
Note there is no checkout: without actions/checkout the workspace is empty, which surprises people the first time.
More on Workflow Anatomy & Execution Model
Define workflow, run, job, step, action and runner in one line each.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`?BeginnerWhat runner images and architectures can you choose from?Intermediate