Skip to main content
tally is designed to run fast in CI without requiring Docker Desktop or a daemon. It produces output in formats that native CI systems understand natively, including GitHub Actions annotations and SARIF for code scanning.

Quick tips

  • Use --fail-level to control which severities fail CI (for example, fail on warning but not on style).
  • Use --exclude to skip generated or vendor trees.
  • Commit a .tally.toml to keep CI and local runs consistent.
  • Use --format github-actions for inline PR annotations on GitHub.
  • Use --format sarif to upload results to GitHub Code Scanning or Azure DevOps.

Basic lint step

Add tally to any workflow that touches Dockerfiles:
name: Lint

on:
  push:
    branches: [main]
  pull_request:

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

      - name: Install tally
        run: npm install -g tally-cli

      - name: Lint Dockerfiles
        run: tally lint --format github-actions .
The github-actions format emits ::warning and ::error annotations that GitHub renders inline in the PR diff.

SARIF upload to Code Scanning

Upload results to GitHub Code Scanning for a persistent view of findings across commits:
name: Lint

on:
  push:
    branches: [main]
  pull_request:
  schedule:
    - cron: "0 6 * * 1"   # Weekly on Monday

jobs:
  tally:
    runs-on: ubuntu-latest
    permissions:
      security-events: write   # Required for SARIF upload

    steps:
      - uses: actions/checkout@v4

      - name: Install tally
        run: npm install -g tally-cli

      - name: Run tally
        run: |
          tally lint \
            --format sarif \
            --output tally.sarif \
            --fail-level none \
            .

      - name: Upload SARIF
        uses: github/codeql-action/upload-sarif@v3
        with:
          sarif_file: tally.sarif
Use --fail-level none when uploading SARIF so the step doesn’t fail before the upload runs. Code Scanning will surface the findings separately.

Matrix strategy for multiple Dockerfiles

Lint different Dockerfiles in parallel using a matrix:
jobs:
  tally:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        dockerfile:
          - Dockerfile
          - Dockerfile.dev
          - services/api/Dockerfile

    steps:
      - uses: actions/checkout@v4

      - name: Install tally
        run: npm install -g tally-cli

      - name: Lint ${{ matrix.dockerfile }}
        run: tally lint --format github-actions ${{ matrix.dockerfile }}

Output format recommendations

CI systemRecommended formatWhy
GitHub Actions (annotations)github-actionsInline PR diff annotations
GitHub Code ScanningsarifPersistent findings in Security tab
GitLab Code QualitysarifSAST artifact support
Azure DevOpssarifSARIF is natively supported
Terminal / localtext (default)Human-readable with source snippets
AI agents / scriptsjson or markdownMachine-readable or token-efficient