Jobs

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

Jobs can be defined using 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
vars map {} Job-level variables
env object {} Job-level environment
include string/list - Include external files
if string - Conditional execution expression
dir string - Working directory override
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
tty bool false Allocate PTY for all steps
interactive bool false Stream output live, connect stdin

Basic Job

  name: Basic Job

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

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..."

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"

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..."

String Shorthand

Jobs can be written as bare strings, useful for simple commands and skills:

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

This is equivalent to:

  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"

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 }}"

See Also