---
url: /zh/build/skip-pipeline.md
description: >
  介绍如何主动跳过 CNB 流水线执行， 包括在 commit message 中使用 [ci skip] 标记和通过 git push 选项跳过，
  以及事件忽略配置。
---
## 主动跳过流水线

可通过以下方式实现：

1. 在最近一个 commit message 中包含 `[ci skip]` 或 `[skip ci]`
2. 使用 `git push -o ci.skip` 选项推送

```bash
# 方式一：在 commit message 中标记
git commit -m "feat: some feature [ci skip]"
git push origin main
```

```bash
# 方式二：通过 push 选项跳过
git commit -m "feat: some feature"
git push origin main -o ci.skip
```

:::tip
上述方式仅在 `push`、`commit.add` 和 `branch.create` 事件中生效。
:::

## 事件忽略

为避免不必要的流水线执行，云原生构建会忽略以下情形：

1. 密钥仓库的文件变更
2. 仓库迁移时 head commit 的时间戳早于仓库创建时间 10 分钟以上
3. 仓库设置中未勾选「允许自动触发」的 Git 操作所触发的事件
4. Fork 仓库未勾选「允许自动触发」时，默认不自动触发
   （除非仓库设置勾选了「Fork 的仓库默认允许自动触发」）
