

亚马逊 CodeCatalyst 不再向新买家开放。现有客户可以继续正常使用该服务。有关更多信息，请参阅 [如何从中迁移 CodeCatalyst](migration.md)。

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 在工作流失败时阻止第三方合并
<a name="extensions-block-merges"></a>

将 GitHub 或 Bitbucket 存储库关联到后 CodeCatalyst，您可以为拉取请求添加 CodeCatalyst 工作流程。同样，在将 GitLab 项目存储库链接到之后， CodeCatalyst 您可以为合并请求添加 CodeCatalyst 工作流程。在一次特定的提交中可以运行一个或多个工作流程，并且中每个工作流程的运行状态 CodeCatalyst 也反映在 GitHub、Bitbucket 或 GitLab中的提交状态中。推送新提交时，新的工作流程[运行状态](https://docs.aws.amazon.com/codecatalyst/latest/userguide/workflows-view-run.html#workflows-view-run-status)将反映在 GitHub、Bitbucket 或 GitLab 该新提交中。如果您再次为提交运行工作流，则新的工作流运行状态将覆盖该提交和工作流的上一个状态。

您可以在 GitHub 或 Bitbucket 中设置分支保护规则以阻止拉取请求合并，或者在 GitLab 最新提交的工作流程运行状态为失败时阻止合并请求。使用分支保护规则，最新提交的状态会影响在、Bitbucket 或 GitLab中 GitHub合并拉取请求的能力。要了解有关工作流的更多信息，请参阅[运行工作流](workflows-working-runs.md)和[使用触发器自动启动工作流运行](workflows-add-trigger.md)。

根据您使用的第三方存储库提供商，请参阅以下内容：
+ **GitHub 存储库**： GitHub的文档[关于状态检查](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks)和[关于受保护的分支](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches)。
+ **Bitbucket 存储库**：Bitbucket 的 [Using branch permissions](https://confluence.atlassian.com/bitbucketserver/using-branch-permissions-776639807.html) 和 [Take control with branch permissions in Bitbucket Cloud](https://bitbucket.org/blog/take-control-with-branch-restrictions) 文档。
+ **GitLab 存储库**： GitLab[自动合并](https://docs.gitlab.com/ee/user/project/merge_requests/auto_merge.html)和[受保护分支](https://docs.gitlab.com/ee/user/project/protected_branches.html)的文档。