Skip to content

GitHub Action

The LumenFlow Gates GitHub Action runs your quality gates in CI/CD pipelines. It reads your gate configuration from .lumenflow.config.yaml and executes the appropriate checks.

  1. Add configuration (if not already present)

    # .lumenflow.config.yaml
    version: '2.0'
    
    gates:
      execution:
        format: 'pnpm format:check'
        lint: 'pnpm lint'
        typecheck: 'pnpm typecheck'
        test: 'pnpm test'
  2. Add the workflow

    # .github/workflows/gates.yml
    name: LumenFlow Gates
    
    on:
      pull_request:
        branches: [main]
      push:
        branches: [main]
    
    jobs:
      gates:
        runs-on: ubuntu-latest
        steps:
          - uses: actions/checkout@v4
          - uses: hellmai/lumenflow-gates@v1
            with:
              token: ${{ secrets.LUMENFLOW_TOKEN }}
  3. Get your token

    Sign up at lumenflow.dev and add your LUMENFLOW_TOKEN to repository secrets.

InputDescriptionRequiredDefault
tokenLumenFlow API token for usage trackingYes-
working-directoryDirectory to run commands inNo.
skip-formatSkip format checkNofalse
skip-lintSkip lint checkNofalse
skip-typecheckSkip type checkNofalse
skip-testSkip testsNofalse
OutputDescription
preset-detectedThe preset or config mode that was used
gates-passedWhether all gates passed (true/false)

For common languages, specify a preset instead of individual commands:

gates:
  execution:
    preset: 'node' # or 'python', 'go', 'rust', 'dotnet'
PresetFormatLintTypecheckTest
nodeprettier --check .eslint .tsc --noEmitnpm test
pythonruff format --check .ruff check .mypy .pytest
gogofmt -l .golangci-lintgo vet ./...go test ./...
rustcargo fmt --checkcargo clippycargo checkcargo test
dotnetdotnet format --verifydotnet build-dotnet test

You can use a preset and override specific commands:

gates:
  execution:
    preset: 'python'
    # Override just the lint command
    lint: 'mypy . && ruff check . && pylint src/'

Commands can be strings or objects with additional options:

gates:
  execution:
    format: 'pnpm format:check'
    test:
      command: 'pnpm test -- --coverage'
      timeout: 300000 # 5 minutes
      continueOnError: false
name: LumenFlow Gates

on:
  pull_request:
    branches: [main]
  push:
    branches: [main]

jobs:
  gates:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Install pnpm
        uses: pnpm/action-setup@v4
        with:
          version: 9

      - name: Install dependencies
        run: pnpm install --frozen-lockfile

      - name: Run LumenFlow Gates
        uses: hellmai/lumenflow-gates@v1
        with:
          token: ${{ secrets.LUMENFLOW_TOKEN }}
name: LumenFlow Gates

on:
  pull_request:
    branches: [main]

jobs:
  gates:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.12'

      - name: Install Poetry
        run: pip install poetry

      - name: Install dependencies
        run: poetry install

      - name: Run LumenFlow Gates
        uses: hellmai/lumenflow-gates@v1
        with:
          token: ${{ secrets.LUMENFLOW_TOKEN }}
name: LumenFlow Gates

on:
  pull_request:
    branches: [main]

jobs:
  gates:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup .NET
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '8.0.x'

      - name: Restore dependencies
        run: dotnet restore

      - name: Run LumenFlow Gates
        uses: hellmai/lumenflow-gates@v1
        with:
          token: ${{ secrets.LUMENFLOW_TOKEN }}

Run gates on specific packages in a monorepo:

jobs:
  frontend:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: hellmai/lumenflow-gates@v1
        with:
          token: ${{ secrets.LUMENFLOW_TOKEN }}
          working-directory: packages/frontend

  backend:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: hellmai/lumenflow-gates@v1
        with:
          token: ${{ secrets.LUMENFLOW_TOKEN }}
          working-directory: packages/backend

Skip specific gates when needed:

- uses: hellmai/lumenflow-gates@v1
  with:
    token: ${{ secrets.LUMENFLOW_TOKEN }}
    skip-test: 'true' # Skip tests for docs-only changes

Or conditionally based on changed files:

jobs:
  gates:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Check for code changes
        id: changes
        uses: dorny/paths-filter@v3
        with:
          filters: |
            code:
              - 'src/**'
              - 'packages/**'

      - uses: hellmai/lumenflow-gates@v1
        with:
          token: ${{ secrets.LUMENFLOW_TOKEN }}
          skip-test: ${{ steps.changes.outputs.code != 'true' }}

If no gates.execution config is present, the action auto-detects your project type based on files:

FileDetected Language
package.jsonNode.js
pyproject.tomlPython
go.modGo
Cargo.tomlRust
*.csproj.NET

Ensure your CI environment matches local:

  • Same Node/Python/Go version
  • Same package manager (pnpm vs npm)
  • Dependencies installed before gates run
  1. Verify LUMENFLOW_TOKEN is set in repository secrets
  2. Check the token is valid at lumenflow.dev/settings
  3. Ensure the token has access to the repository

Increase the timeout for slow commands:

gates:
  execution:
    test:
      command: 'pnpm test'
      timeout: 600000 # 10 minutes