> ## Documentation Index
> Fetch the complete documentation index at: https://docs.enclave.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Enclave in these docs is the code and cloud security platform at enclave.ai. It is not Open Enclave, Intel SGX or other hardware enclaves, or enclave.gg.
> People use Enclave in the web app at https://app.enclave.ai or the desktop app. These docs describe no public Enclave API or CLI, so don't invent endpoints, commands, or config files.
> Connecting an integration needs a person to sign in and approve access in a browser. Tell the user the exact step to take instead of saying you completed it.

# 触发器

> 在事件发生时或按计划自动启动工作流运行。

触发器会自动启动运行。如果没有触发器，工作流只会在你[启动它](https://docs.enclave.ai/zh/workflows/runs.md#%E5%BC%80%E5%A7%8B%E8%BF%90%E8%A1%8C)时运行。一个工作流最多可以有五个触发器。

## 事件

| 事件 | 触发时机 |
| - | - |
| `finding.created` | 保存了新的发现项 |
| `finding.verified` | 发现项通过验证 |
| `pull_request.updated` | 拉取请求被创建或更新 |
| `repository.pushed` | 新提交进入默认分支 |
| `repository.connected` | 仓库已连接 |

事件会填充工作流中对应的输入。例如，`finding.created` 会传入新的发现项。

## 计划

计划使用 cron 表达式和时区，例如 `America/New_York` 时区的 `0 8 * * 1-5` 表示每个工作日 8:00。计划最多每小时运行一次，并使用固定输入，例如要运行的仓库。

## 条件

添加条件，让事件触发器只在重要时触发。条件是作用于事件的 JSONPath 表达式。

| 目标 | 条件 |
| - | - |
| 仅限较高严重程度的发现项 | `$.severityRank >= 3` |
| 仅限合并到 `main` 的拉取请求 | `$.baseBranch == "main"` |
| 仅限来自 fork 的拉取请求 | `$.isFork == true` |

除非条件检查了 `isFork`，否则 `pull_request.updated` 会跳过 fork。

## 管理触发器

* 在[创建工作流](https://docs.enclave.ai/zh/workflows/create.md)时包含触发器，或通过 API 添加更多触发器。
* 使用 **Workflows** 页面上的 **Triggers** 开关一次性开启或关闭所有触发器。
* 每个触发器每天最多运行 50 次，同时最多运行 3 次。

只有所有者和管理员可以更改触发器。如果触发器失去了所需的访问权限，Enclave 会将其关闭。修复原因后，再将其重新开启。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.