Extensions - Azure DevOps

Azure DevOps Task

The GauntletCI Azure Pipelines task installs the CLI, analyzes the current commit, and emits inline annotations in the pipeline run summary - the same red error and yellow warning markers you see from build tasks and test runners.

Install the extension

  1. 1.Go to the Azure DevOps Marketplace
  2. 2.Search for "GauntletCI"
  3. 3.Click Get and choose your organization
  4. 4.Confirm the installation - no restart required

Once installed, the GauntletCI@0 task is available in the YAML task library and in the Classic editor task picker.

YAML pipeline

Add this to a new pipeline file in your repository. The pipeline runs on every pull request targeting main.

trigger: none
pr:
  branches:
    include: [main]

pool:
  vmImage: ubuntu-latest

steps:
  - task: UseDotNet@2
    inputs:
      version: '8.0.x'

  - task: GauntletCI@0
    displayName: 'GauntletCI - Analyze PR'
    inputs:
      sensitivity: 'balanced'
      failOnBlock: true
      workingDirectory: '$(Build.SourcesDirectory)'
      gauntletciVersion: 'latest'

How annotations look in Azure Pipelines

Block findings appear as red inline errors in the pipeline run summary. Warn findings appear as yellow warnings. Both link to the source file and line number when a path is available.

Pipeline - Build - GauntletCI Analyze
00:01GauntletCI: 3 finding(s) from 42 rules evaluated.
00:01
error OrderService.cs(44): [GCI0001] Behavior change without test coverage.
00:01
error PaymentService.cs(112): [GCI0003] Exception path added with no callers updated.
00:01
warning Models/Order.cs(23): [GCI0004] Return type semantics changed.
00:01##[error]GauntletCI: 2 block-level finding(s) detected. See annotations above.

Task inputs

InputDefaultDescription
sensitivitybalancedstrict | balanced | permissive. Controls the confidence threshold for findings.
failOnBlocktrueSet the task result to Failed when any Block-severity finding is produced.
workingDirectory$(Build.SourcesDirectory)Root of the .NET repository. Passed as the working directory for the GauntletCI process.
gauntletciVersionlatestNuGet version to install. Use 'latest' or pin to a specific version such as '2.1.1'.

Manual install (without the Marketplace task)

If you cannot install from the Marketplace or prefer full control, use the raw script steps below. These work identically to the task.

# Equivalent manual steps if not using the Marketplace task
- script: dotnet tool install -g GauntletCI
  displayName: 'Install GauntletCI'

- script: |
    export PATH="$PATH:$HOME/.dotnet/tools"
    git diff origin/$(System.PullRequest.TargetBranch)...HEAD > pr.diff
    gauntletci analyze --diff pr.diff --no-banner --ascii
  displayName: 'Run GauntletCI'
  failOnStderr: false

Branch policy enforcement

To block PRs from completing when GauntletCI finds blocking issues, add the pipeline as a required build policy on your target branch. In the Azure DevOps project settings, go to Repos > Branches > Branch policies for main, add a Build validation policy, and select your GauntletCI pipeline. Set it to Required.