Skip to content

Commit 24c6838

Browse files
authored
Merge pull request #697 from linear-b/improve-triggers-for-dependabot-bump
Add 'on' event triggers to Dependabot automation examples
2 parents 46e4bfc + 7a05b9e commit 24c6838

File tree

5 files changed

+35
-6
lines changed

5 files changed

+35
-6
lines changed

docs/downloads/automation-library/integrations/dependabot/approve_dependabot.cm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ manifest:
55

66
automations:
77
approve_dependabot:
8+
on:
9+
- pr_created
10+
- commit
811
if:
912
- {{ branch.name | includes(term="dependabot") }}
1013
- {{ branch.author | includes(term="dependabot") }}
@@ -16,4 +19,4 @@ automations:
1619
- action: merge@v1
1720
args:
1821
wait_for_all_checks: true
19-
squash_on_merge: true
22+
squash_on_merge: true

docs/downloads/automation-library/integrations/dependabot/approve_dependabot_minor.cm

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ manifest:
33

44
automations:
55
merge_dependabot_minor:
6+
on:
7+
- pr_created
8+
- commit
69
if:
710
- {{ bump == 'minor' }}
811
- {{ branch.name | includes(term="dependabot") }}
@@ -14,6 +17,9 @@ automations:
1417
comment: |
1518
Dependabot `minor` version bumps are approved automatically.
1619
merge_dependabot_minor_patch:
20+
on:
21+
- pr_created
22+
- commit
1723
if:
1824
- {{ bump == 'patch' }}
1925
- {{ branch.name | includes(term="dependabot") }}
@@ -26,4 +32,4 @@ automations:
2632
comment: |
2733
Dependabot `patch` version bumps are approved and merged automatically.
2834

29-
bump: {{ pr.description | extractDependabotVersionBump | compareSemver }}
35+
bump: {{ pr.description | extractDependabotVersionBump | compareSemver }}

docs/execution-model.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,19 @@ The `triggers` section in gitStream gives you precise control over when automati
4242

4343
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
4444

45+
<div class="trigger-details" markdown=1>
4546
| Key | Type | Description |
4647
| ----------------------------------------------------- | ----------------- | -------------------------------------------------------------- |
4748
| `triggers.on` :fontawesome-brands-github: | [String] | Specifies the explicit triggers that initiate the automations. |
4849
| `triggers.include.branch` :fontawesome-brands-github: | [String or regex] | Branches that match will trigger the automation. |
4950
| `triggers.exclude.branch` :fontawesome-brands-github: | [String or regex] | Branches that match will not trigger the automation. |
5051
| `triggers.include.repository` | [String or regex] | Repositories that match will trigger the automation. |
5152
| `triggers.exclude.repository` | [String or regex] | Repositories that match will not trigger the automation. |
53+
</div>
5254

5355
The table below lists supported explicit triggers, categorized into those enabled by default and those that require manual activation.
5456

57+
<div class="trigger-details" markdown=1>
5558
| Triggering event | Explicit Trigger :fontawesome-brands-github: | Default (implicit triggers) |
5659
| --------------------------------------------------------------------- | -------------------------------------------- | ------------------------------ |
5760
| Creating a PR | `pr_created` | `on` |
@@ -67,6 +70,7 @@ The table below lists supported explicit triggers, categorized into those enable
6770
| :fontawesome-brands-github: transition from any state to closed | `pr_closed` | `off` |
6871
| :fontawesome-brands-github: transition from closed to open | `pr_reopened` | `off` |
6972
| :fontawesome-brands-github: Transition from any state to approved | `pr_approved` | If there is an automation with one of the actions: `require-reviewers`, `set-required-approvals` or `merge`, or uses `pr.approvals` context variable |
73+
</div>
7074

7175
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.
7276
If an automation block does not have explicit triggers configured, it will be triggered according to the default (implicit) triggers.
@@ -145,6 +149,9 @@ triggers:
145149
146150
automations:
147151
bump_minor:
152+
on:
153+
- pr_created
154+
- commit
148155
if:
149156
- {{ bump == 'minor' }}
150157
- {{ branch.name | includes(term="dependabot") }}
@@ -157,6 +164,9 @@ automations:
157164
Dependabot `minor` version bumps are approved automatically.
158165
159166
bump_patch:
167+
on:
168+
- pr_created
169+
- commit
160170
if:
161171
- {{ bump == 'patch' }}
162172
- {{ branch.name | includes(term="dependabot") }}

docs/stylesheets/extra.css

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
h2 {
77
padding-top: 4%;
8-
}
8+
}
99

1010
h4 {
1111
padding-top: 4%;
12-
}
12+
}
1313

1414
/* make the first column wider as usually this is a variable name that cant wrap normally */
1515
th:nth-child(1){
@@ -24,6 +24,10 @@ div.filter-details th:nth-child(1){
2424
width: 20%;
2525
}
2626

27+
div.trigger-details th:nth-child(2){
28+
width: 30%;
29+
}
30+
2731
/* change the table colors for light mode */
2832
[data-md-color-scheme="default"] table th{
2933
background: #D8DADE;
@@ -104,7 +108,7 @@ div.flow-chart {
104108
color: gray;
105109
}
106110

107-
.tabbed-content .md-typeset .admonition {
111+
.tabbed-content .md-typeset .admonition {
108112
font-size: .8rem;
109113
}
110114

@@ -178,7 +182,7 @@ div.flow-chart {
178182
width:auto;
179183
height: 3em;
180184
}
181-
185+
182186
.integrations-card-labels {
183187
font-size: 0.7em;
184188
color: #9aa4ad; /* this is a medium grey color */

plugins/filters/extractDependabotVersionBump/extract_dependabot_version_bump.cm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ manifest:
33

44
automations:
55
bump_minor:
6+
on:
7+
- pr_created
8+
- commit
69
if:
710
- {{ bump == 'minor' }}
811
- {{ branch.name | includes(term="dependabot") }}
@@ -15,6 +18,9 @@ automations:
1518
Dependabot `minor` version bumps are approved automatically.
1619

1720
bump_patch:
21+
on:
22+
- pr_created
23+
- commit
1824
if:
1925
- {{ bump == 'patch' }}
2026
- {{ branch.name | includes(term="dependabot") }}

0 commit comments

Comments
 (0)