Skip to content

Commit 3af35c1

Browse files
authored
Clarify explicit vs implicit triggers and improve documentation (#808)
This adds a new warning box explaining when implicit triggers are disabled, clarifies that `include`/`exclude` filters don't change triggering events, and improves several explanations throughout the execution model documentation to reduce confusion about trigger behavior.
1 parent 9f77a5d commit 3af35c1

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

docs/execution-model.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Trigger Control
22

33
!!! warning "Platform Limitations"
4-
**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.
4+
**Explicit triggers** (using `on`, `triggers.on`, `triggers.include`, and `triggers.exclude` parameters) are only supported on GitHub :fontawesome-brands-github:.
5+
6+
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.
57

68
However, other execution control concepts covered in this document, such as action-level execution control, apply to all supported platforms (GitHub, GitLab, and Bitbucket).
79

@@ -41,14 +43,19 @@ gitstream supports an explicit triggering mechanism. When using explicit trigger
4143

4244
Triggers can be defined globally at the file level or specifically for each automation. Triggers are applied only to the file(s) where they are declared.
4345

46+
!!! important "When Implicit Triggers Are Disabled"
47+
Implicit triggers are disabled ONLY when using `triggers.on` (file-level) or `on` (automation-level) - these parameters define explicit triggering events and completely override the default implicit trigger behavior.
48+
49+
When using ONLY `triggers.include` or `triggers.exclude` implicit triggers remain active - these parameters filter which branches/repositories run automations but do not change the triggering events themselves.
50+
4451
!!! Note "Combining File-Level and Automation-Level Triggers"
4552
When both file-level explicit triggers and automation-level explicit triggers exist, the actual triggers used will be the result of unifying both lists. This means the automation will be triggered by any event specified in either the file-level triggers or the automation-level triggers.
4653

4754
#### `triggers` section
4855

49-
The `triggers` section in gitStream gives you precise control over when automations execute. It allows you to define conditions based on pull request events using `include` and `exclude` lists to specify branch and repository patterns. These lists determine which branches or repositories trigger or bypass automation but do not affect the events initiating automations.
56+
The `triggers` section in gitStream gives you precise control over when automations execute. It allows you to define conditions based on pull request events using `include` and `exclude` lists to specify branch and repository patterns. These lists determine which branches or repositories trigger or bypass automation but do not affect the events initiating automations - implicit triggers remain active when using only `include` and `exclude`.
5057

51-
Additionally, the `on` keyword defines specific events that trigger automations. It can be added at the file level (under the `triggers` section) or within individual automations for greater customization. Multiple triggers can be stacked, meaning gitStream will execute the automation for each matching triggering event, allowing flexibility in defining automation behavior
58+
Additionally, the `on` keyword defines specific events that trigger automations. It can be added at the file level (under the `triggers` section) or within individual automations for greater customization. When `on` is used, it switches from implicit to explicit triggering mode, meaning only the specified events will trigger automations. Multiple triggers can be stacked, meaning gitStream will execute the automation for each matching triggering event, allowing flexibility in defining automation behavior
5259

5360
<div class="trigger-details" markdown=1>
5461
| Key | Type | Description |
@@ -81,8 +88,8 @@ The table below lists supported explicit triggers, categorized into those enable
8188
| Transition from any state to approved :fontawesome-brands-github: | `pr_approved` | `on` | when actions `require-reviewers`, `set-required-approvals`, or `merge` are used, or when `pr` context is used in `.cm` |
8289
</div>
8390

84-
Explicit triggers are set independently per each automation block and can be configured at the file level, specific to each automation separately or in combination. If triggers are listed at the file level **and** specific automation, the automation will be triggered according to both triggers.
85-
If an automation block does not have explicit triggers configured, it will be triggered according to the default (implicit) triggers.
91+
Explicit triggers (using `on`) are set independently per each automation block and can be configured at the file level, specific to each automation separately or in combination. If triggers are listed at the file level and specific automation, the automation will be triggered according to both triggers.
92+
If an automation block does not have the `on` parameter configured (explicit triggers), it will be triggered according to the default (implicit) triggers, even if `triggers.include` or `triggers.exclude` are used at the file level.
8693

8794
!!! Note
8895
The `on` parameter can be used within individual automation blocks, while `triggers.include` and `triggers.exclude` can only be defined at the file level.
@@ -208,6 +215,8 @@ manifest:
208215
version: 1.0
209216
210217
# Disable triggering when the PR is created by bots
218+
# Note: Only using triggers.exclude means implicit triggers remain active
219+
# (automations will still trigger on commits, PR creation, etc.)
211220
triggers:
212221
exclude:
213222
branch:
@@ -231,6 +240,8 @@ And the other automations file is set to automate Dependabot PRs:
231240
manifest:
232241
version: 1.0
233242
243+
# Note: triggers.include still allows implicit triggers
244+
# However, the automations below use 'on' which switches to explicit mode
234245
triggers:
235246
include:
236247
branch:

0 commit comments

Comments
 (0)