azure-pipelines-validator
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAzure Pipelines Validator
Azure Pipelines 验证工具
Comprehensive toolkit for validating, linting, testing, and securing Azure DevOps Pipeline configurations (azure-pipelines.yml, azure-pipelines.yaml files). Use this skill when working with Azure Pipelines, validating pipeline syntax, debugging configuration issues, implementing best practices, or performing security audits.
用于验证、代码检查、测试和保障Azure DevOps Pipeline配置(azure-pipelines.yml、azure-pipelines.yaml文件)安全的综合工具包。当你处理Azure Pipelines、验证管道语法、调试配置问题、实施最佳实践或执行安全审计时,可使用此工具。
When to Use This Skill
适用场景
Use the azure-pipelines-validator skill in the following scenarios:
- ✅ Working with or
azure-pipelines.ymlfilesazure-pipelines.yaml - ✅ Validating Azure Pipelines YAML syntax and structure
- ✅ Debugging pipeline configuration errors
- ✅ Implementing Azure Pipelines best practices
- ✅ Performing security audits on pipeline configurations
- ✅ Checking for hardcoded secrets or credentials
- ✅ Optimizing pipeline performance (caching, parallelization)
- ✅ Ensuring compliance with security standards
- ✅ Code review of Azure DevOps CI/CD configurations
- ✅ Migrating or refactoring pipeline configurations
在以下场景中使用azure-pipelines-validator工具:
- ✅ 处理或
azure-pipelines.yml文件azure-pipelines.yaml - ✅ 验证Azure Pipelines YAML语法和结构
- ✅ 调试管道配置错误
- ✅ 实施Azure Pipelines最佳实践
- ✅ 对管道配置执行安全审计
- ✅ 检查硬编码的密钥或凭证
- ✅ 优化管道性能(缓存、并行化)
- ✅ 确保符合安全标准
- ✅ 代码审查Azure DevOps CI/CD配置
- ✅ 迁移或重构管道配置
Features
功能特性
0. YAML Linting (Optional)
0. YAML代码检查(可选)
- ✅ YAML formatting validation with yamllint
- ✅ Indentation checking (2-space standard)
- ✅ Line length validation
- ✅ Trailing spaces detection
- ✅ Custom Azure Pipelines YAML rules
- ✅ Automatic venv management (no manual install required)
- ✅ 使用yamllint验证YAML格式
- ✅ 缩进检查(2空格标准)
- ✅ 行长度验证
- ✅ 末尾空格检测
- ✅ 自定义Azure Pipelines YAML规则
- ✅ 自动虚拟环境管理(无需手动安装)
1. Syntax Validation
1. 语法验证
- ✅ YAML syntax checking
- ✅ Azure Pipelines schema validation
- ✅ Required fields verification
- ✅ Stages/Jobs/Steps hierarchy validation
- ✅ Task format validation (TaskName@version)
- ✅ Pool/agent specification validation
- ✅ Deployment job strategy validation
- ✅ Trigger and PR configuration validation
- ✅ Resource definitions validation
- ✅ Variable and parameter declarations
- ✅ Dependency validation (dependsOn)
- ✅ YAML语法检查
- ✅ Azure Pipelines schema验证
- ✅ 必填字段验证
- ✅ 阶段/作业/步骤层级验证
- ✅ 任务格式验证(TaskName@version)
- ✅ 代理池/Agent规格验证
- ✅ 部署作业策略验证
- ✅ 触发器和PR配置验证
- ✅ 资源定义验证
- ✅ 变量和参数声明验证
- ✅ 依赖关系验证(dependsOn)
2. Best Practices Checking
2. 最佳实践检查
- ✅ displayName usage for readability
- ✅ Task version pinning (specific @N not @0)
- ✅ Pool vmImage specific versions (not 'latest')
- ✅ Cache usage for package managers
- ✅ Timeout configuration for long-running jobs
- ✅ Deployment job conditions
- ✅ Artifact retention settings
- ✅ Parallel execution opportunities
- ✅ Template usage recommendations
- ✅ Variable group organization
- ✅ Deployment strategy best practices
- ✅ 使用displayName提升可读性
- ✅ 固定任务版本(使用特定@N而非@0)
- ✅ 代理池vmImage使用特定版本(而非'latest')
- ✅ 为包管理器使用缓存
- ✅ 为长时间运行的作业配置超时
- ✅ 部署作业条件配置
- ✅ 制品保留设置
- ✅ 并行执行机会识别
- ✅ 模板使用建议
- ✅ 变量组组织建议
- ✅ 部署策略最佳实践
3. Security Scanning
3. 安全扫描
- ✅ Hardcoded secrets and credentials detection
- ✅ API keys and tokens in variables
- ✅ Task version security
- ✅ Container image security (:latest tags)
- ✅ Dangerous script patterns (curl | bash, eval)
- ✅ Service connection security
- ✅ Secret exposure in logs
- ✅ Checkout security settings
- ✅ Variable security (isSecret flag)
- ✅ Azure credential hardcoding
- ✅ SSL/TLS verification bypasses
- ✅ 检测硬编码的密钥和凭证
- ✅ 检测变量中的API密钥和令牌
- ✅ 任务版本安全检查
- ✅ 容器镜像安全检查(:latest标签风险)
- ✅ 危险脚本模式检测(curl | bash、eval)
- ✅ 服务连接安全检查
- ✅ 日志中的密钥泄露风险检查
- ✅ 代码检出安全设置检查
- ✅ 变量安全性检查(isSecret标记)
- ✅ Azure凭证硬编码检测
- ✅ SSL/TLS验证绕过检测
Usage
使用方法
Basic Validation
基础验证
To validate an Azure Pipelines configuration file:
bash
bash .claude/skills/azure-pipelines-validator/scripts/validate_azure_pipelines.sh <file-path>Example:
bash
bash .claude/skills/azure-pipelines-validator/scripts/validate_azure_pipelines.sh azure-pipelines.ymlThis runs all four validation layers:
0. YAML lint (yamllint) - optional, auto-installed in venv if needed
- Syntax validation
- Best practices check
- Security scan
验证Azure Pipelines配置文件:
bash
bash .claude/skills/azure-pipelines-validator/scripts/validate_azure_pipelines.sh <file-path>示例:
bash
bash .claude/skills/azure-pipelines-validator/scripts/validate_azure_pipelines.sh azure-pipelines.yml此命令运行全部四个验证层级:
0. YAML代码检查(yamllint)- 可选,若需要会自动在虚拟环境中安装
- 语法验证
- 最佳实践检查
- 安全扫描
Validation Options
验证选项
bash
undefinedbash
undefinedRun only syntax validation
仅运行语法验证
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --syntax-only
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --syntax-only
Run only best practices check
仅运行最佳实践检查
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --best-practices
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --best-practices
Run only security scan
仅运行安全扫描
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --security-only
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --security-only
Skip YAML linting (yamllint)
跳过YAML代码检查(yamllint)
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --skip-yaml-lint
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --skip-yaml-lint
Skip best practices check
跳过最佳实践检查
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --no-best-practices
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --no-best-practices
Skip security scan
跳过安全扫描
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --no-security
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --no-security
Strict mode (fail on warnings)
严格模式(警告视为失败)
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --strict
undefinedbash scripts/validate_azure_pipelines.sh azure-pipelines.yml --strict
undefinedIndividual Validators
独立验证脚本
You can also run individual validation scripts:
bash
undefined你也可以运行单独的验证脚本:
bash
undefinedSyntax validation
语法验证
python3 scripts/validate_syntax.py azure-pipelines.yml
python3 scripts/validate_syntax.py azure-pipelines.yml
Best practices check
最佳实践检查
python3 scripts/check_best_practices.py azure-pipelines.yml
python3 scripts/check_best_practices.py azure-pipelines.yml
Security scan
安全扫描
python3 scripts/check_security.py azure-pipelines.yml
undefinedpython3 scripts/check_security.py azure-pipelines.yml
undefinedOutput Example
输出示例
════════════════════════════════════════════════════════════════════════════════
Azure Pipelines Validator
════════════════════════════════════════════════════════════════════════════════
File: azure-pipelines.yml
[1/3] Running syntax validation...
✓ Syntax validation passed
[2/3] Running best practices check...
SUGGESTIONS (2):
──────────────────────────────────────────────────────────────────────────────
INFO: Line 15: Job 'BuildJob' should have displayName for better readability [missing-displayname]
💡 Suggestion: Add 'displayName: "Your Job Description"' to job 'BuildJob'
WARNING: Line 25: Task 'Npm@1' in job 'BuildJob' could benefit from caching [missing-cache]
💡 Suggestion: Add Cache@2 task to cache dependencies and speed up builds
ℹ Best practices check completed with suggestions
[3/3] Running security scan...
MEDIUM SEVERITY (1):
──────────────────────────────────────────────────────────────────────────────
MEDIUM: Line 8: Container 'linux' uses ':latest' tag [container-latest-tag]
🔒 Remediation: Pin container images to specific versions or SHA digests
✓ Security scan passed
════════════════════════════════════════════════════════════════════════════════
Validation Summary
════════════════════════════════════════════════════════════════════════════════
Syntax Validation: PASSED
Best Practices: WARNINGS
Security Scan: PASSED
════════════════════════════════════════════════════════════════════════════════
✓ All validation checks passed════════════════════════════════════════════════════════════════════════════════
Azure Pipelines Validator
════════════════════════════════════════════════════════════════════════════════
File: azure-pipelines.yml
[1/3] Running syntax validation...
✓ Syntax validation passed
[2/3] Running best practices check...
SUGGESTIONS (2):
──────────────────────────────────────────────────────────────────────────────
INFO: Line 15: Job 'BuildJob' should have displayName for better readability [missing-displayname]
💡 Suggestion: Add 'displayName: "Your Job Description"' to job 'BuildJob'
WARNING: Line 25: Task 'Npm@1' in job 'BuildJob' could benefit from caching [missing-cache]
💡 Suggestion: Add Cache@2 task to cache dependencies and speed up builds
ℹ Best practices check completed with suggestions
[3/3] Running security scan...
MEDIUM SEVERITY (1):
──────────────────────────────────────────────────────────────────────────────
MEDIUM: Line 8: Container 'linux' uses ':latest' tag [container-latest-tag]
🔒 Remediation: Pin container images to specific versions or SHA digests
✓ Security scan passed
════════════════════════════════════════════════════════════════════════════════
Validation Summary
════════════════════════════════════════════════════════════════════════════════
Syntax Validation: PASSED
Best Practices: WARNINGS
Security Scan: PASSED
════════════════════════════════════════════════════════════════════════════════
✓ All validation checks passedCommon Validation Scenarios
常见验证场景
Scenario 1: Validating a New Pipeline
场景1:验证新管道
bash
undefinedbash
undefinedValidate syntax and structure
验证语法和结构
bash scripts/validate_azure_pipelines.sh new-pipeline.yml
undefinedbash scripts/validate_azure_pipelines.sh new-pipeline.yml
undefinedScenario 2: Security Audit Before Merge
场景2:合并前的安全审计
bash
undefinedbash
undefinedRun security scan only with strict mode
仅运行安全扫描并启用严格模式
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --security-only --strict
undefinedbash scripts/validate_azure_pipelines.sh azure-pipelines.yml --security-only --strict
undefinedScenario 3: Pipeline Optimization
场景3:管道优化
bash
undefinedbash
undefinedCheck for best practices and optimization opportunities
检查最佳实践和优化机会
bash scripts/validate_azure_pipelines.sh azure-pipelines.yml --best-practices
undefinedbash scripts/validate_azure_pipelines.sh azure-pipelines.yml --best-practices
undefinedScenario 4: CI/CD Integration
场景4:CI/CD集成
yaml
undefinedyaml
undefinedIn your Azure Pipeline
在你的Azure Pipeline中
trigger:
branches:
include:
- main
pool:
vmImage: 'ubuntu-22.04'
steps:
- script: | pip3 install PyYAML bash .claude/skills/azure-pipelines-validator/scripts/validate_azure_pipelines.sh azure-pipelines.yml --strict displayName: 'Validate Pipeline Configuration'
undefinedtrigger:
branches:
include:
- main
pool:
vmImage: 'ubuntu-22.04'
steps:
- script: | pip3 install PyYAML bash .claude/skills/azure-pipelines-validator/scripts/validate_azure_pipelines.sh azure-pipelines.yml --strict displayName: 'Validate Pipeline Configuration'
undefinedIntegration with Claude Code
与Claude Code集成
When Claude Code invokes this skill, it will:
- Auto-detect Azure Pipelines files - Run the validator without arguments to auto-detect files in the current directory (up to 3 levels deep)
azure-pipelines*.yml - Run validation when you ask to validate, check, or review Azure Pipelines configurations
- Provide actionable feedback with line numbers and suggestions
- Stage-aware condition checking - Recognizes when parent stages have conditions, avoiding false positives on deployment jobs
- Deduplicated findings - Reports each security issue once, even if detected by multiple patterns
Example prompts:
- "Validate my Azure Pipeline"
- "Check this azure-pipelines.yml for security issues"
- "Review my pipeline configuration for best practices"
- "Why is my Azure Pipeline failing?"
- "Optimize my Azure DevOps pipeline"
当Claude Code调用此工具时,将:
- 自动检测Azure Pipelines文件 - 无需参数即可运行验证器,自动检测当前目录(最多3层深度)中的文件
azure-pipelines*.yml - 运行验证 当你请求验证、检查或审查Azure Pipelines配置时
- 提供可操作的反馈 包含行号和改进建议
- 阶段感知条件检查 - 识别父阶段的条件,避免部署作业的误报
- 去重检测结果 - 每个安全问题仅报告一次,即使被多个模式检测到
示例提示:
- "验证我的Azure Pipeline"
- "检查这个azure-pipelines.yml的安全问题"
- "审查我的管道配置是否符合最佳实践"
- "为什么我的Azure Pipeline失败了?"
- "优化我的Azure DevOps管道"
When to Use Context7/WebSearch for Documentation
何时使用Context7/WebSearch查找文档
The validation scripts provide static analysis. For dynamic documentation lookup, manually use these tools when you need:
- Task version information: "What's the latest version of AzureWebApp task?"
- Task input parameters: "What inputs does Docker@2 support?"
- Feature documentation: "How do I configure deployment environments in Azure Pipelines?"
- Troubleshooting: "Why does my AzureCLI@2 task fail with error X?"
How to fetch documentation:
undefined验证脚本提供静态分析。若需要动态文档查询,当你需要以下信息时手动使用这些工具:
- 任务版本信息:"AzureWebApp任务的最新版本是什么?"
- 任务输入参数:"Docker@2支持哪些输入参数?"
- 功能文档:"如何在Azure Pipelines中配置部署环境?"
- 故障排除:"为什么我的AzureCLI@2任务报错X?"
获取文档的方法:
undefinedUse Context7 MCP for structured docs
使用Context7 MCP获取结构化文档
mcp__context7__resolve-library-id("azure-pipelines")
mcp__context7__get-library-docs(context7CompatibleLibraryID, topic="deployment")
mcp__context7__resolve-library-id("azure-pipelines")
mcp__context7__get-library-docs(context7CompatibleLibraryID, topic="deployment")
Or use WebSearch/WebFetch for Microsoft Learn docs
或使用WebSearch/WebFetch获取Microsoft Learn文档
WebSearch("Azure Pipelines Docker@2 task documentation 2025")
WebFetch("https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/docker-v2")
**Note**: Documentation lookup is a manual action - the validator scripts focus on static analysis and do not automatically fetch external documentation.WebSearch("Azure Pipelines Docker@2 task documentation 2025")
WebFetch("https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/docker-v2")
**注意**:文档查询是手动操作 - 验证脚本专注于静态分析,不会自动获取外部文档。Validation Rules
验证规则
Syntax Rules
语法规则
- : Valid YAML formatting
yaml-syntax - : Root must be a dictionary
yaml-invalid-root - : Cannot mix stages/jobs/steps at root level
invalid-hierarchy - : Tasks must follow TaskName@version format
task-invalid-format - : Pool must specify name or vmImage
pool-invalid - : Stages must define jobs
stage-missing-jobs - : Regular jobs must define steps
job-missing-steps - : Deployment jobs must define strategy
deployment-missing-strategy - : Variables should use valid naming
variable-invalid-name
- : 验证YAML格式
yaml-syntax - : 根节点必须是字典
yaml-invalid-root - : 根级别不能混合stages/jobs/steps
invalid-hierarchy - : 任务必须遵循TaskName@version格式
task-invalid-format - : 代理池必须指定name或vmImage
pool-invalid - : 阶段必须定义jobs
stage-missing-jobs - : 常规作业必须定义steps
job-missing-steps - : 部署作业必须定义strategy
deployment-missing-strategy - : 变量应使用有效命名
variable-invalid-name
Best Practice Rules
最佳实践规则
- : Stages/jobs should have displayName
missing-displayname - : Tasks should not use @0 version (except whitelisted tasks where @0 is the only version: GoTool, NodeTool, UsePythonVersion, KubernetesManifest, DockerCompose, HelmInstaller, HelmDeploy)
task-version-zero - : Tasks must specify version
task-missing-version - : Avoid 'latest' in vmImage
pool-latest-image - : Package installations should use caching
missing-cache - : Deployment jobs should specify timeout
missing-timeout - : Production deployments should have conditions
missing-deployment-condition - : Test jobs could use parallelization
parallel-opportunity - : Duplicate job patterns could use templates
template-opportunity - : Consider using variable groups
many-inline-variables
- : 阶段/作业应设置displayName
missing-displayname - : 任务不应使用@0版本(除了白名单任务,这些任务只有@0版本:GoTool、NodeTool、UsePythonVersion、KubernetesManifest、DockerCompose、HelmInstaller、HelmDeploy)
task-version-zero - : 任务必须指定版本
task-missing-version - : 避免在vmImage中使用'latest'
pool-latest-image - : 包安装应使用缓存
missing-cache - : 部署作业应指定超时
missing-timeout - : 生产部署应设置条件
missing-deployment-condition - : 测试作业可使用并行化
parallel-opportunity - : 重复的作业模式可使用模板
template-opportunity - : 考虑使用变量组
many-inline-variables
Security Rules
安全规则
- : Hardcoded passwords detected
hardcoded-password - : Hardcoded API keys detected
hardcoded-api-key - : Hardcoded secrets/tokens detected
hardcoded-secret - : AWS credentials hardcoded
hardcoded-aws-credentials - : Azure subscription/tenant IDs hardcoded
hardcoded-azure-ids - : Dangerous curl | bash pattern
curl-pipe-shell - : Eval command usage with variables
eval-command - : Overly permissive file permissions
chmod-777 - : SSL/TLS verification disabled
insecure-ssl - : Potential secret exposure in logs
secret-in-logs - : Container using :latest tag
container-latest-tag - : Task missing version (security risk)
task-no-version - : Service connection IDs hardcoded
hardcoded-service-connection - : Checkout without clean
checkout-no-clean - : Sensitive variable not marked as secret
variable-not-secret
- : 检测到硬编码密码
hardcoded-password - : 检测到硬编码API密钥
hardcoded-api-key - : 检测到硬编码密钥/令牌
hardcoded-secret - : 检测到硬编码AWS凭证
hardcoded-aws-credentials - : 检测到硬编码Azure订阅/租户ID
hardcoded-azure-ids - : 检测到危险的curl | bash模式
curl-pipe-shell - : 检测到使用变量的eval命令
eval-command - : 检测到过度宽松的文件权限
chmod-777 - : 检测到SSL/TLS验证被禁用
insecure-ssl - : 检测到日志中的密钥泄露风险
secret-in-logs - : 检测到容器使用:latest标签
container-latest-tag - : 检测到任务未指定版本(安全风险)
task-no-version - : 检测到硬编码服务连接ID
hardcoded-service-connection - : 检测到代码检出未启用clean
checkout-no-clean - : 检测到敏感变量未标记为secret
variable-not-secret
Requirements
环境要求
- Python 3.7+
- PyYAML and yamllint: Auto-installed in venv if not available systemwide
- Bash: For running the orchestrator script
No manual installation required! The validator uses automatic venv management:
- If PyYAML or yamllint are available system-wide, they'll be used
- Otherwise, a persistent is created and packages are auto-installed
.venv - The venv is reused across runs for optimal performance
To manually install dependencies system-wide (optional):
bash
pip3 install PyYAML yamllint- Python 3.7+
- PyYAML和yamllint:若系统未安装,会自动在虚拟环境中安装
- Bash:用于运行编排脚本
无需手动安装! 验证器使用自动虚拟环境管理:
- 若系统已安装PyYAML或yamllint,将直接使用
- 否则,会创建持久化的并自动安装依赖包
.venv - 虚拟环境会在多次运行中复用以提升性能
若需手动在系统层面安装依赖(可选):
bash
pip3 install PyYAML yamllintDocumentation
文档
Comprehensive documentation is included in the directory:
docs/- : Complete Azure Pipelines YAML syntax reference with examples
azure-pipelines-reference.md
完整文档位于目录:
docs/- :包含示例的完整Azure Pipelines YAML语法参考
azure-pipelines-reference.md
Examples
示例
Example Azure Pipelines configurations are provided in the directory:
examples/- : Simple CI pipeline with build and test stages
basic-pipeline.yml - : Docker build and push workflow
docker-build.yml - : Multi-environment deployment with approval gates
deployment-pipeline.yml - : Multi-platform build matrix
multi-platform.yml - : Pipeline using reusable templates
template-example.yml
Test the skill with examples:
bash
bash scripts/validate_azure_pipelines.sh examples/basic-pipeline.ymlexamples/- :包含构建和测试阶段的简单CI管道
basic-pipeline.yml - :Docker构建和推送工作流
docker-build.yml - :带审批门的多环境部署管道
deployment-pipeline.yml - :多平台构建矩阵
multi-platform.yml - :使用可复用模板的管道
template-example.yml
使用示例测试工具:
bash
bash scripts/validate_azure_pipelines.sh examples/basic-pipeline.ymlFetching Latest Documentation
获取最新文档
When encountering specific Azure Pipelines tasks, resources, or version requirements, you can manually use the following tools to get up-to-date information:
- Use Context7 MCP to fetch version-aware Azure Pipelines documentation
- Use WebSearch to find latest Azure DevOps documentation
- Use WebFetch to retrieve specific documentation pages from learn.microsoft.com
Note: These tools are not automatically invoked by the validation scripts. Use them manually when you need to look up specific Azure Pipelines tasks, features, or troubleshoot validation errors.
当遇到特定的Azure Pipelines任务、资源或版本要求时,可手动使用以下工具获取最新信息:
- 使用Context7 MCP 获取版本感知的Azure Pipelines文档
- 使用WebSearch 查找最新的Azure DevOps文档
- 使用WebFetch 从learn.microsoft.com获取特定文档页面
注意:这些工具不会被验证脚本自动调用。当你需要查找特定Azure Pipelines任务、功能或排查验证错误时,手动使用它们。
Extending the Skill
扩展工具
Adding Custom Validation Rules
添加自定义验证规则
Add custom rules to the validation scripts:
- Syntax rules: Edit
scripts/validate_syntax.py - Best practice rules: Edit
scripts/check_best_practices.py - Security rules: Edit
scripts/check_security.py
在验证脚本中添加自定义规则:
- 语法规则:编辑
scripts/validate_syntax.py - 最佳实践规则:编辑
scripts/check_best_practices.py - 安全规则:编辑
scripts/check_security.py
Custom Rule Example
自定义规则示例
python
undefinedpython
undefinedIn check_best_practices.py
In check_best_practices.py
def _check_custom_rule(self):
"""Check for custom organization rule"""
for job in self._get_all_jobs():
job_name = job.get('job') or job.get('deployment')
# Your custom validation logic
if 'tags' not in pool:
self.issues.append(BestPracticeIssue(
'warning',
self._get_line(job_name),
f"Job '{job_name}' should specify agent tags",
'custom-missing-tags',
"Add 'tags' to pool to select appropriate agents"
))undefineddef _check_custom_rule(self):
"""Check for custom organization rule"""
for job in self._get_all_jobs():
job_name = job.get('job') or job.get('deployment')
# Your custom validation logic
if 'tags' not in pool:
self.issues.append(BestPracticeIssue(
'warning',
self._get_line(job_name),
f"Job '{job_name}' should specify agent tags",
'custom-missing-tags',
"Add 'tags' to pool to select appropriate agents"
))undefinedTroubleshooting
故障排除
Python Module Not Found
Python模块未找到
bash
undefinedbash
undefinedInstall PyYAML
安装PyYAML
pip3 install PyYAML
pip3 install PyYAML
Or with homebrew Python
或使用Homebrew Python
python3 -m pip install PyYAML
undefinedpython3 -m pip install PyYAML
undefinedPermission Denied
权限拒绝
bash
undefinedbash
undefinedMake scripts executable
为脚本添加执行权限
chmod +x scripts/.sh scripts/.py
undefinedchmod +x scripts/.sh scripts/.py
undefinedValidation Errors
验证错误
Check the documentation:
- Review for syntax reference
docs/azure-pipelines-reference.md - Consult Azure Pipelines documentation at https://learn.microsoft.com/en-us/azure/devops/pipelines/
查阅文档:
- 查看获取语法参考
docs/azure-pipelines-reference.md - 访问Azure Pipelines官方文档:https://learn.microsoft.com/en-us/azure/devops/pipelines/
Version History
版本历史
v1.0.0 (2025-01-24)
v1.0.0 (2025-01-24)
- Initial release
- Syntax validation with comprehensive Azure Pipelines schema checking
- Best practices validation with 10+ rules
- Security scanning with 20+ security checks
- Comprehensive documentation and examples
- Integration with Context7 for latest Azure DevOps docs
- 初始版本
- 包含全面Azure Pipelines schema检查的语法验证
- 包含10+规则的最佳实践验证
- 包含20+安全检查的安全扫描
- 完整的文档和示例
- 与Context7集成以获取最新Azure DevOps文档
Contributing
贡献
To improve this skill:
- Add new validation rules to appropriate scripts
- Update documentation with new patterns
- Add example configurations
- Test with real-world Azure Pipelines files
若要改进此工具:
- 为相应脚本添加新的验证规则
- 更新文档以包含新的模式
- 添加示例配置
- 使用真实世界的Azure Pipelines文件进行测试
License
许可证
This skill is part of the DevOps Skills collection.
此工具属于DevOps技能集合的一部分。
Support
支持
For issues, questions, or contributions:
- Check documentation in directory
docs/ - Review examples in directory
examples/ - Consult Azure Pipelines documentation: https://learn.microsoft.com/en-us/azure/devops/pipelines/
Remember: This skill validates Azure Pipelines configurations but does not execute pipelines. Use Azure DevOps Pipeline validation or Azure CLI for testing actual pipeline execution.
若遇到问题、疑问或想要贡献:
- 查看目录中的文档
docs/ - 查看目录中的示例
examples/ - 查阅Azure Pipelines官方文档:https://learn.microsoft.com/en-us/azure/devops/pipelines/
注意:此工具仅验证Azure Pipelines配置,不执行管道。测试实际管道执行请使用Azure DevOps Pipeline验证功能或Azure CLI。