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.Go to the Azure DevOps Marketplace
- 2.Search for "GauntletCI"
- 3.Click Get and choose your organization
- 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.
Task inputs
| Input | Default | Description |
|---|---|---|
| sensitivity | balanced | strict | balanced | permissive. Controls the confidence threshold for findings. |
| failOnBlock | true | Set 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. |
| gauntletciVersion | latest | NuGet 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: falseBranch 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.
