mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-11 18:35:18 +00:00
docs: update Azure DevOps pipeline instructions for PR-Agent (#2017)
* docs: update Azure DevOps pipeline instructions for PR-Agent * docs: enhance Azure DevOps pipeline instructions with PR trigger configuration
This commit is contained in:
parent
12eea7acf3
commit
9ad8e921b5
1 changed files with 24 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
|||
## Azure DevOps Pipeline
|
||||
|
||||
You can use a pre-built Action Docker image to run PR-Agent as an Azure devops pipeline.
|
||||
You can use a pre-built Action Docker image to run PR-Agent as an Azure DevOps pipeline.
|
||||
Add the following file to your repository under `azure-pipelines.yml`:
|
||||
|
||||
```yaml
|
||||
|
|
@ -8,12 +8,16 @@ Add the following file to your repository under `azure-pipelines.yml`:
|
|||
trigger: none
|
||||
|
||||
# Configure PR trigger
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- '*'
|
||||
autoCancel: true
|
||||
drafts: false
|
||||
# pr:
|
||||
# branches:
|
||||
# include:
|
||||
# - '*'
|
||||
# autoCancel: true
|
||||
# drafts: false
|
||||
|
||||
# NOTE for Azure Repos Git:
|
||||
# Azure Repos does not honor YAML pr: triggers. Configure Build Validation
|
||||
# via Branch Policies instead (see note below). You can safely omit pr:.
|
||||
|
||||
stages:
|
||||
- stage: pr_agent
|
||||
|
|
@ -61,6 +65,19 @@ Make sure to give pipeline permissions to the `pr_agent` variable group.
|
|||
|
||||
> Note that Azure Pipelines lacks support for triggering workflows from PR comments. If you find a viable solution, please contribute it to our [issue tracker](https://github.com/Codium-ai/pr-agent/issues)
|
||||
|
||||
### Azure Repos Git PR triggers and Build Validation
|
||||
|
||||
Azure Repos Git does not use YAML `pr:` triggers for pipelines. Instead, configure Build Validation on the target branch to run the PR Agent pipeline for pull requests:
|
||||
|
||||
1. Go to Project Settings → Repositories → Branches.
|
||||
2. Select the target branch and open Branch Policies.
|
||||
3. Under Build Validation, add a policy:
|
||||
- Select the PR Agent pipeline (the `azure-pipelines.yml` above).
|
||||
- Set it as Required.
|
||||
4. Remove the `pr:` section from your YAML (not needed for Azure Repos Git).
|
||||
|
||||
This distinction applies specifically to Azure Repos Git. Other providers like GitHub and Bitbucket Cloud can use YAML-based PR triggers.
|
||||
|
||||
## Azure DevOps from CLI
|
||||
|
||||
To use Azure DevOps provider use the following settings in configuration.toml:
|
||||
|
|
|
|||
Loading…
Reference in a new issue