Articles
Published · November 18, 2026

Reading a GitHub Actions Workflow File: on, jobs, and steps

A workflow file is YAML in three layers: on decides when it runs, jobs hold the work, and steps do it. Learn to read each key so a hand-edited file stops looking like noise.

Also in: Español中文हिन्दी

A GitHub Actions workflow file is a YAML file with three layers: on says when it runs, jobs holds the work, and steps inside each job do the work. Find those three keys and most workflow files read like a short list of instructions, not a wall of indentation.

The file is YAML, so indentation is structure

GitHub describes a workflow as "a configurable automated process that will run one or more jobs," defined by a YAML file checked in to your repository. Per the GitHub Actions documentation on workflows, these files live in the .github/workflows directory, and a repository can have several of them. The workflow syntax reference adds that the file must end in .yml or .yaml.

Every workflow has the same parts: one or more events that trigger it, one or more jobs that each run on a runner machine, and steps inside each job. A step either runs a script you wrote or runs an action, which is a reusable extension.

It's YAML, so nesting is meaning. A step indented one level too far silently belongs to something else, or fails to parse. If you hit that, our guide to YAML indentation errors walks through reading the message. And if you are weighing formats for your own files, see choosing a config format you hand-edit.

on: what starts the workflow

The on key defines which events can cause the workflow to run. The simplest form names one event:

on: push

You can list several. With multiple events, only one of them needs to occur to trigger the run:

on: [push, fork]

Most real files go one level deeper and filter the event. This runs only for pushes to main or to branches under releases/:

on:
  push:
    branches:
      - main
      - 'releases/**'

A few details help when you read these:

  • You cannot use both branches and branches-ignore for the same event.
  • paths and paths-ignore filter by which files changed, for example paths: ['**.js'].
  • A schedule trigger uses POSIX cron syntax and runs in UTC by default.

name, run-name, and env

Three optional top-level keys sit beside on. name is what GitHub shows under the repository's Actions tab; if you leave it out, GitHub shows the file path instead. run-name names each individual run. env is a map of variables available to the steps of every job. If a step defines a variable with the same name, the step's value wins over the job-level and workflow-level ones.

jobs: the units that run on a runner

Under jobs, each entry is a job with a unique ID. The ID must start with a letter or _ and contain only letters, numbers, -, or _. A job can also have a name, which is what the GitHub interface displays.

The key you will see in every job is runs-on, which defines the type of machine the job runs on:

jobs:
  test:
    runs-on: ubuntu-latest

Jobs don't wait for each other by default. To order them, use needs, which lists jobs that must complete successfully first:

jobs:
  build:
    runs-on: ubuntu-latest
  deploy:
    runs-on: ubuntu-latest
    needs: build

Here deploy waits for build. A list works too: needs: [build, test].

steps: run and uses

Each job has a steps list, and each item in it starts with a dash. A step does one of two things.

run executes a command you write. uses selects an action to run as part of the step. Both can carry a name, which is the label GitHub shows in the log:

steps:
  - name: Check out repository code
    uses: actions/checkout@v6
  - name: List files in the repository
    run: |
      ls

The | after run: starts a literal block, so every following indented line is part of the command. If that syntax is new, our explainer on YAML multiline strings covers it. A step can also have an id, which lets later steps refer to it, and an if, which prevents the step from running unless a condition is met.

Reading a whole file

The GitHub quickstart gives a demo workflow that pulls it all together. Trimmed to its skeleton, it reads like this:

name: GitHub Actions Demo
on: [push]
jobs:
  Explore-GitHub-Actions:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository code
        uses: actions/checkout@v6
      - name: List files in the repository
        run: |
          ls

Read it top to bottom. The workflow is named "GitHub Actions Demo", it runs on every push, it has one job called Explore-GitHub-Actions on an Ubuntu runner, and that job has two steps, one that checks out the code and one that lists files. According to the quickstart, committing the file to a branch triggers the push event, and the run log shows how each step was processed.

How Carets fits in

Workflow files are small, hand-edited YAML, the kind you sometimes need to open and fix away from a desk. Carets is a native notes and code editor for iPhone, iPad, and Mac that handles Markdown, plain text, and code in one place. Syntax highlighting makes the indentation and keys in a .yml file easier to scan, and files, projects, and tags keep your workflow snippets organized. Your files stay plain text, so they remain portable. It is a lightweight editor, not a full IDE, so it suits reading and quick edits rather than running the workflow.

Get Carets on the App Store for iPhone, iPad, and Mac.

Frequently Asked Questions

Where do workflow files go?

In the .github/workflows directory of your repository, with a .yml or .yaml extension. A repository can hold more than one workflow file.

What is the difference between a job and a step?

A job runs on one runner machine and contains a series of steps. Each step runs either a script you define or an action.

Do jobs run in order?

Not by default. Add needs to a job to make it wait until the listed jobs have completed successfully.

What does uses do compared with run?

uses selects an action, a reusable extension, to run as part of a step. run executes a command or script you write yourself.