CollabOps

Validation Rules

Workflow YAML validation rules — YAML syntax, required fields, DAG, and naming conventions

Workflow YAML files are validated upon saving. The following rules must be observed.

YAML Syntax

# ✅ Valid YAML — indented with spaces
jobs:
  build:
    steps:
      - name: test
        run: npm test

# ❌ Invalid YAML — tab characters are not allowed
jobs:
	build:       # Tab character → error
		steps:

Only space-based indentation is allowed (no tabs)

Duplicate keys are not allowed — you cannot declare the same key twice at the same level

Required Fields

A workflow file must include the following fields.

# ✅ Minimal valid workflow
name: minimal-workflow          # Required: Workflow name

triggers:                        # Required: At least 1 event
  push:
    branches: [main]

jobs:                            # Required: At least 1 job
  build:
    steps:                       # Required: At least 1 step
      - name: hello
        run: echo "Hello"
FieldRequiredValidation
nameYESMaximum 255 characters, no control characters
triggersYESMust contain at least 1 event
jobsYESMust contain at least 1 job
jobs.<id>.stepsYESMust contain at least 1 step

DAG Validity

Job dependencies (needs) must form a valid DAG (Directed Acyclic Graph).

# ✅ Valid DAG
jobs:
  a:
    steps: [...]
  b:
    needs: [a]
    steps: [...]
  c:
    needs: [a, b]
    steps: [...]

# ❌ Circular dependency — a → b → c → a
jobs:
  a:
    needs: [c]    # c waits for a, and a waits for c → cycle
    steps: [...]
  b:
    needs: [a]
    steps: [...]
  c:
    needs: [b]
    steps: [...]

# ❌ Self-reference
jobs:
  build:
    needs: [build]    # Cannot reference itself
    steps: [...]

# ❌ Reference to a non-existent job
jobs:
  deploy:
    needs: [build]    # build job is not defined → error
    steps: [...]

Naming Rules

Workflow name

Maximum 255 characters

No control characters (newlines, tabs, etc.)

Case-insensitive

Job ID

# ✅ Valid Job IDs
jobs:
  build:          # Lowercase letters
  unit-test:      # Hyphens allowed
  deploy_prod:    # Underscores allowed
  Job123:         # Numbers allowed

# ❌ Invalid Job IDs
jobs:
  "my build":     # Spaces not allowed
  "deploy!":      # Special characters not allowed

Allowed characters: [a-zA-Z0-9_-]

Maximum 255 characters

Case-insensitive

Must be unique within the workflow

Step name

Allowed characters: [a-zA-Z0-9_-]

Length: 1 to 255 characters

Must be unique within the same job

Table of Contents