59 lines
2.3 KiB
YAML
59 lines
2.3 KiB
YAML
# Lint the CODEOWNERS file for a given repository and filter out baseline errors
|
|
# Note: Due to the nature of the verifications, which includes source paths/globs
|
|
# for the repository, this pipeline cannot use sparse-checkout.
|
|
trigger: none
|
|
|
|
pr:
|
|
branches:
|
|
include:
|
|
- main
|
|
- feature/*
|
|
- hotfix/*
|
|
- release/*
|
|
paths:
|
|
include:
|
|
- .github/CODEOWNERS
|
|
- .github/CODEOWNERS_baseline_errors.txt
|
|
- eng/common/pipelines/codeowners-linter.yml
|
|
|
|
stages:
|
|
- stage: Run
|
|
variables:
|
|
skipComponentGovernanceDetection: true
|
|
nugetMultiFeedWarnLevel: 'none'
|
|
|
|
jobs:
|
|
- job: Run
|
|
timeoutInMinutes: 120
|
|
pool:
|
|
name: azsdk-pool-mms-ubuntu-2204-general
|
|
vmImage: ubuntu-22.04
|
|
|
|
variables:
|
|
CodeownersLinterVersion: '1.0.0-dev.20240227.2'
|
|
DotNetDevOpsFeed: "https://pkgs.dev.azure.com/azure-sdk/public/_packaging/azure-sdk-for-net/nuget/v3/index.json"
|
|
RepoLabelUri: "https://azuresdkartifacts.blob.core.windows.net/azure-sdk-write-teams/repository-labels-blob"
|
|
TeamUserUri: "https://azuresdkartifacts.blob.core.windows.net/azure-sdk-write-teams/azure-sdk-write-teams-blob"
|
|
UserOrgUri: "https://azuresdkartifacts.blob.core.windows.net/azure-sdk-write-teams/user-org-visibility-blob"
|
|
|
|
steps:
|
|
# Skip sparse checkout for the `azure-sdk-for-<lang>-pr` private mirrored repositories
|
|
# as we require the github service connection to be loaded.
|
|
- ${{ if not(contains(variables['Build.DefinitionName'], '-pr - ')) }}:
|
|
- template: /eng/common/pipelines/templates/steps/sparse-checkout.yml
|
|
parameters:
|
|
Paths:
|
|
- '/*'
|
|
|
|
- task: DotNetCoreCLI@2
|
|
displayName: 'Install CodeownersLinter'
|
|
inputs:
|
|
command: custom
|
|
custom: 'tool'
|
|
arguments: 'install --global --add-source "$(DotNetDevOpsFeed)" --version "$(CodeownersLinterVersion)" "Azure.Sdk.Tools.CodeownersLinter"'
|
|
workingDirectory: '$(Build.SourcesDirectory)/eng/common'
|
|
- pwsh: |
|
|
codeowners-linter --repoRoot $(Build.SourcesDirectory) --repoName $(Build.Repository.Name) -fbl -rUri "$(RepoLabelUri)" -tUri "$(TeamUserUri)" -uUri "$(UserOrgUri)"
|
|
displayName: 'Lint CODEOWNERS and filter using baseline'
|
|
workingDirectory: '$(Build.SourcesDirectory)/eng/common'
|