Skip to content

Commit 79f39cc

Browse files
authored
Add example for enabling AI actions on draft PRs (#780)
1 parent 7f630ed commit 79f39cc

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

docs/execution-model.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
!!! warning "Platform Limitations"
44
**Explicit triggers** (using `on`, `triggers.on`, `triggers.include`, and `triggers.exclude` parameters) are only supported on GitHub :fontawesome-brands-github:. Using explicit triggers in GitLab or Bitbucket will cause the automation to fail with an error. For GitLab and Bitbucket, simply omit trigger configuration to use implicit triggers automatically.
5-
5+
66
However, other execution control concepts covered in this document, such as action-level execution control, apply to all supported platforms (GitHub, GitLab, and Bitbucket).
77

88
gitStream is triggered on new pull requests (PRs) for repositories that have gitStream installed. Upon triggering, gitStream collects context variables and evaluates the automation rules to determine which ones are relevant.
@@ -178,6 +178,24 @@ With implicit triggers (no explicit triggers configured), `describe-changes` wil
178178

179179
## Examples
180180

181+
182+
#### Enable AI Actions on Draft PRs
183+
By default, AI actions like `code-review` don't run on draft PRs. To enable it, use explicit triggers with `pr_created` and `commit`:
184+
185+
```yaml+jinja
186+
automations:
187+
ai_review_on_drafts:
188+
on:
189+
- pr_created
190+
- commit
191+
if:
192+
- true
193+
run:
194+
- action: code-review@v1
195+
```
196+
197+
This allows developers to get AI feedback during the coding process before marking the PR as ready for review.
198+
181199
#### Dependabot and Renovate
182200

183201
For example, you can have your normal automations that help developers with their PRs and a separate automation that automates Dependabot or Renovate version bumps. Both automations serve distinctly different purposes: the first helps your developers streamline their PRs, while the other reduces developers' toil by auto-approving version bumps. You will not want to unnecessarily trigger gitStream for Dependabot or Renovate, so you can configure the triggers to exclude the branch where Dependabot or Renovate PRs are created.

0 commit comments

Comments
 (0)