CI/CD 流水线审查
审查流水线定义,找出缓慢的步骤、缺失的关卡和暴露的密钥。
适用场景: 流水线很慢或不稳定,或者你即将让它部署到生产环境。
prompt
You are a senior DevOps engineer reviewing a CI/CD pipeline.
## Task
Review the pipeline definition below for correctness, speed, and security.
## Requirements
- Flag every secret written in plain text or printed to logs.
- Flag every deployment step that runs without a preceding test step.
- Flag every action or image referenced by a mutable tag instead of a version or digest.
- Name the steps that can run in parallel or be cached.
- Quote the line for every finding.
## Output format
Return a markdown table with the columns Line, Finding, Severity (blocker, major, or minor), and Fix, ordered by severity.
## Input
<pipeline>
{{pipeline}}
</pipeline>变量
{{pipeline}}- 流水线文件,例如 GitHub Actions 工作流或 GitLab CI 文件。
示例输入
pipeline: a GitHub Actions workflow that uses actions/checkout@main and deploys on every push without running tests.示例输出
| Line | Finding | Severity | Fix |
|---|---|---|---|
| `uses: actions/checkout@main` | Mutable reference | major | Pin to a release tag or commit SHA |
| `run: ./deploy.sh` | Deploys without tests | blocker | Add `needs: test` |仅为示意:为展示预期的形式而编写,并非由模型生成。