Jobs

Jobs define units of work in a pipeline. Each job contains steps to execute.

A pipeline defines jobs with either jobs: (GitHub Actions style) or tasks: (Taskfile style). Both are interchangeable.

Properties

Field Type Default Description
desc string - Short description for --list
steps list [] Steps to execute
cmds list [] Alias for steps
run string - Single command (creates synthetic step)
cmd string - Alias for run
depends_on string/list [] Jobs to run before this job
for string/list - Run the job once per item
vars map {} Job-level variables
env object {} Job-level environment
include string/list - Include external files
if string/list - Conditional execution (list items ANDed)
dir string - Working directory for the job's steps
aliases list [] Alternative names for invoking this job
requires list [] Variables required when invoked in loop
timeout string - Execution timeout (e.g., 10m , 300s )
detach bool false Run in background
show bool auto Show in --list (root jobs shown)
summarize bool false Summarize output
quiet bool false Suppress output
passthru bool false Print output with tree indentation
interactive bool false Stream output live, connect stdin

A job gets a PTY when stdout is a terminal, and colour follows terminal detection: a run redirected to a pipe or a file captures no escape sequences.

Basic Job

  name: Basic Job

jobs:
  build:
    aliases: [default]
    desc: Build the application
    steps:
      - run: echo "Building..."
      - run: echo "Build complete"

Basic Job

Job Dependencies

Jobs can depend on other jobs using depends_on :

  name: Job Dependencies

jobs:
  default:
    desc: Run everything
    depends_on: [lint, test]
    steps:
      - run: echo "All checks passed"

  lint:
    desc: Check code style
    steps:
      - run: echo "Linting..."

  test:
    desc: Run tests
    steps:
      - run: echo "Testing..."

Job Dependencies

Detached Jobs

Run jobs in the background with detach: true :

  name: Detached Jobs

jobs:
  background:
    aliases: [default]
    desc: Run in background
    detach: true
    steps:
      - run: echo "Starting background task"
      - run: sleep 1
      - run: echo "Background task done"

  foreground:
    desc: Run in foreground
    steps:
      - run: echo "Foreground continues immediately"

Detached Jobs

Conditional Jobs

Execute jobs conditionally using if :

  name: Conditional Jobs

vars:
  deploy: false

jobs:
  build:
    aliases: [default]
    desc: Always runs
    steps:
      - run: echo "Building..."

  deploy:
    desc: Only when deploy is true
    if: deploy == true
    depends_on: [build]
    steps:
      - run: echo "Deploying..."

Conditional Jobs

String Shorthand

A job can be a bare string, useful for simple commands and skills:

  jobs:
  build: go build ./...
  test: go test ./...
  lint: golangci-lint run

This matches:

  jobs:
  build:
    desc: go build ./...
    steps:
      - go build ./...
  name: String Shorthand

tasks:
  up:
    aliases: [default]
    steps:
      - run: echo "Starting services"
  down: echo "Stopping services"
  status: echo "Checking status"
  logs: echo "Showing logs"

String Shorthand

Job Variables

Jobs can define their own variables that merge with pipeline-level ones:

  name: Job Variables

vars:
  app: myapp

jobs:
  build:
    aliases: [default]
    vars:
      output: bin
    steps:
      - run: echo "Building ${{ app }} to ${{ output }}"

  test:
    vars:
      coverage: true
    steps:
      - run: echo "Testing ${{ app }} with coverage=${{ coverage }}"

Job Variables

See Also