Interview Prep/GitHub Actions/Workflow Anatomy & Execution Model

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.

All GitHub Actions questions Roadmap: GitHub Actions

More on Workflow Anatomy & Execution Model