← Reference

Pipeline YAML

Complete specification for .gittan.yaml — every field, constraint, and default.

The .gittan.yaml file in a repo’s root defines its pipeline. It is optional — repos without one get their pipeline from matching org policies.

Top-level fields

FieldTypeRequiredDefaultDescription
stepsarrayNo[]Pipeline steps. Empty array means no repo override — policies apply.
gatedstring[]No["main"]Branches where pushes are gated. A failing pipeline on a gated branch rejects the push.
dependsDependency[]No—Cross-repo dependencies for cascade pipelines.
notifyNotifyConfigNo—Notification channels for failures and review requests.
linksobjectNo—External links shown in the UI: docs, grafana, status, homepage.

Step fields

FieldTypeRequiredDescription
namestringYesUnique identifier. 1–64 chars, lowercase alphanumeric and hyphens only (/^[a-z0-9-]+$/).
imagestringNoContainer image for this step. Omit to use the detected default for the project type.
runstringNoShell command to execute.
usestringNoReference to a shared step by name. Resolves image, run, and defaults from the registry.
withRecord<string, string>NoParameters passed to a shared step.
envRecord<string, string>NoEnvironment variables. Use ${{ secrets.NAME }} for secrets.
needsstring[]NoStep names this step depends on. Defines the DAG — steps without dependencies run in parallel.
publishobjectNoImage publish config. Fields: image (required), dockerfile (default: Dockerfile).
onlystringNoBranch filter. Supports exact match, * (all branches), and trailing-star patterns (release/*). Publish steps without an explicit only default to main.
secretsstring[]NoSecret names this step needs access to. Resolved from repo → team → org scope.
cachestring[]NoPaths to cache between pipeline runs. Package manager stores (.pnpm-store, .npm, .cache/pip, .cache/uv) are shared org-wide; all other paths are repo-scoped. See cache behavior.
artifactsstring[]NoPaths to persist as build artifacts.
servicesarrayNoSidecar services. Each entry is a string (image name) or an object with image and optional env.
timeoutstringNoMax duration for the step. Default: 10m.
descriptionstringNoHuman-readable purpose. Max 200 characters.

Review step

A special step type that gates the pipeline on human code review. The step name must be exactly review.

FieldTypeDefaultDescription
nameliteral—Must be review.
requireinteger1Number of approvals required. Minimum 1.
fromstringwriterswriters or admins. Who can approve.
autoAssignstringblameblame, round-robin, or none. Reviewer auto-assignment strategy.
needsstring[]—Steps that must pass before the review opens.
skipForstring[]—Users who can skip review (e.g. bot accounts).

Dependency object

Declares a cross-repo dependency for cascade pipelines. When the upstream repo pushes, a cascade run triggers in the downstream repo.

FieldTypeRequiredDefaultDescription
repostringYes—Upstream repo name.
teamstringNo—Team the upstream repo belongs to. Inferred if omitted.
cascadebooleanNotrueTrigger a cascade run when the upstream pushes.
contractTestbooleanNotrueRun contract tests between the repos.

Notify config

notify:
  onFailure:
    - channel: team-slack
      template: detailed
    - channel: author
  onReviewNeeded:
    - channel: team-slack
FieldTypeDescription
channelstringteam-slack, author, or webhook.
targetstringOptional. Webhook URL or specific channel for webhook notifications.
templatestringcompact (default) or detailed.

Resolution behavior

A repo’s final pipeline is not just its .gittan.yaml — it is the union of steps from matching policies and the repo config:

  1. Enforce policies always contribute their steps when the match rule hits.
  2. Platform policies (secret-scan, dep-scan, policy-scan) each have their own blocking behavior — secret-scan and dep-scan (CRITICAL) block the push, policy-scan is advisory.
  3. Base steps come from the repo’s .gittan.yaml if it defines steps, otherwise from matching mode: default policies.
  4. A .gittan.yaml with only metadata (depends, links, no steps) does not override default policies.
  5. Publish steps without an explicit only get only: main automatically — feature-branch pushes never become production deploys.
  6. Step name dedup: first occurrence wins. Enforce steps are placed first.

Publish config: .gittan.config.yaml

A separate file from .gittan.yaml. Drop a .gittan.config.yaml in the repo root to override image publishing defaults.

FieldTypeDefaultDescription
imagestringrepo nameOverride the published image name.
platformstringnativeTarget platform for Docker builds (e.g. linux/arm64).

Image tags

Published image tags must match the format YYYYMMDD-HHMMSS-sha (e.g. 20260612-143022-a1b2c3d). The :latest tag is rejected. See image pinning.

Full example

steps:
  - name: install
    run: pnpm install --frozen-lockfile

  - name: test
    run: pnpm test
    needs: [install]
    services:
      - postgres:16
    env:
      DATABASE_URL: postgres://test:test@localhost:5432/test

  - name: build
    run: pnpm build
    needs: [install]

  - name: review
    require: 1
    from: writers
    autoAssign: blame
    needs: [test, build]

  - name: publish
    publish:
      image: api
      dockerfile: Dockerfile
    needs: [review]
    secrets: [NPM_TOKEN]

gated:
  - main
  - release/*

depends:
  - repo: shared-types
    cascade: true

notify:
  onFailure:
    - channel: team-slack
      template: detailed
    - channel: author
  onReviewNeeded:
    - channel: team-slack

links:
  docs: https://docs.example.com
  grafana: https://grafana.example.com/d/api