Skip to content

Commit 240afc9

Browse files
authored
Add bot filtering to LinearB AI integrations (#750)
1 parent 9384faf commit 240afc9

File tree

10 files changed

+53
-13
lines changed

10 files changed

+53
-13
lines changed

docs/automation-actions.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ automations:
298298
- commit
299299
if:
300300
- {{ not pr.draft }}
301-
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
301+
- {{ not (is.bot_author or is.bot_branch) }}
302302
run:
303303
- action: code-review@v1
304304
args:
@@ -313,6 +313,10 @@ guidelines: |
313313
- In Javascript
314314
- Make sure camelCase is used for variable names
315315
- Make sure PascalCase is used for class names
316+
is:
317+
bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
318+
bot_branch: {{ branch.name | match(list=['renovate/']) | some }}
319+
316320
```
317321

318322
```yaml+jinja title="example - guidelines from file"
@@ -323,12 +327,16 @@ automations:
323327
- commit
324328
if:
325329
- {{ not pr.draft }}
326-
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
330+
- {{ not (is.bot_author or is.bot_branch) }}
327331
run:
328332
- action: code-review@v1
329333
args:
330334
approve_on_LGTM: false
331335
guidelines: {{ "./REVIEW_RULES.md" | readFile() | dump }}
336+
337+
is:
338+
bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
339+
bot_branch: {{ branch.name | match(list=['renovate/']) | some }}
332340
```
333341

334342
!!! tip "Loading Guidelines from Files"
@@ -421,7 +429,7 @@ automations:
421429
# skip description for Draft PRs and PRs from bots
422430
if:
423431
- {{ not pr.draft }}
424-
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
432+
- {{ not (is.bot_author or is.bot_branch) }}
425433
run:
426434
- action: describe-changes@v1
427435
args:
@@ -436,6 +444,10 @@ guidelines: |
436444
437445
# Load the PR template content from a file in the repository
438446
TEMPLATE: {{ ".github/PULL_REQUEST_TEMPLATE.md" | readFile() | dump }}
447+
448+
is:
449+
bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
450+
bot_branch: {{ branch.name | match(list=['renovate/']) | some }}
439451
```
440452

441453
!!! tip "Excluded Files"

docs/downloads/automation-library/integrations/LinearBAI/code-review-bb.cm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ manifest:
44
automations:
55
linearb_ai_review:
66
if:
7-
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
7+
- {{ not (is.bot_author or is.bot_branch) }}
88
run:
99
- action: code-review@v1
1010
args:
@@ -20,3 +20,7 @@ approve_pr_on_lgtm: false
2020
# the team repo.
2121
# Note: To when the file is in the `cm` repo, use this example: `../cm/REVIEW_RULES.md`
2222
guidelines: {{ "./REVIEW_RULES.md" | readFile() | dump }}
23+
24+
is:
25+
bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
26+
bot_branch: {{ branch.name | match(list=['renovate/']) | some }}

docs/downloads/automation-library/integrations/LinearBAI/code-review-gl.cm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ automations:
55
linearb_ai_review:
66
if:
77
- {{ not pr.draft }}
8-
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
8+
- {{ not (is.bot_author or is.bot_branch) }}
99
run:
1010
- action: code-review@v1
1111
args:
@@ -21,3 +21,7 @@ approve_pr_on_lgtm: false
2121
# the team repo.
2222
# Note: To when the file is in the `cm` repo, use this example: `../cm/REVIEW_RULES.md`
2323
guidelines: {{ "./REVIEW_RULES.md" | readFile() | dump }}
24+
25+
is:
26+
bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
27+
bot_branch: {{ branch.name | match(list=['renovate/']) | some }}

docs/downloads/automation-library/integrations/LinearBAI/code-review.cm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ automations:
99
- commit
1010
if:
1111
- {{ not pr.draft }}
12-
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
12+
- {{ not (is.bot_author or is.bot_branch) }}
1313
run:
1414
- action: code-review@v1
1515
args:
@@ -26,3 +26,7 @@ approve_pr_on_lgtm: false
2626
# - For team-specific guidelines: Place the file in the team repository root
2727
# The `dump` filter ensures proper YAML formatting when the file content is inserted
2828
guidelines: {{ "./REVIEW_RULES.md" | readFile() | dump }}
29+
30+
is:
31+
bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
32+
bot_branch: {{ branch.name | match(list=['renovate/']) | some }}

docs/downloads/automation-library/integrations/LinearBAI/describe-pr-bb.cm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@ automations:
55
linearb_ai_description:
66
# skip description for Draft PRs and PRs from bots
77
if:
8-
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
8+
- {{ not (is.bot_author or is.bot_branch) }}
99
run:
1010
- action: describe-changes@v1
1111
args:
1212
concat_mode: append
13+
14+
is:
15+
bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
16+
bot_branch: {{ branch.name | match(list=['renovate/']) | some }}

docs/downloads/automation-library/integrations/LinearBAI/describe-pr-gl.cm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ automations:
66
# skip description for Draft PRs and PRs from bots
77
if:
88
- {{ not pr.draft }}
9-
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
9+
- {{ not (is.bot_author or is.bot_branch) }}
1010
run:
1111
- action: describe-changes@v1
1212
args:
1313
concat_mode: append
14+
15+
is:
16+
bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
17+
bot_branch: {{ branch.name | match(list=['renovate/']) | some }}

docs/downloads/automation-library/integrations/LinearBAI/describe-pr.cm

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ automations:
1111
# skip description for Draft PRs and PRs from bots
1212
if:
1313
- {{ not pr.draft }}
14-
- {{ pr.author | match(list=['github-actions', '_bot_', 'dependabot', '[bot]']) | nope }}
14+
- {{ not (is.bot_author or is.bot_branch) }}
1515
run:
1616
- action: describe-changes@v1
1717
args:
1818
concat_mode: append
19+
20+
21+
is:
22+
bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
23+
bot_branch: {{ branch.name | match(list=['renovate/']) | some }}

docs/downloads/gitStream-gl.cm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ automations:
2020
linearb_ai_description:
2121
if:
2222
- {{ not pr.draft }}
23-
- {{ not is.bot }}
23+
- {{ not (is.bot_author or is.bot_branch) }}
2424
run:
2525
- action: describe-changes@v1
2626
args:
@@ -82,4 +82,5 @@ is:
8282
docs: {{ files | allDocs }}
8383
tests: {{ files | allTests }}
8484
image: {{ files | allImages }}
85-
bot: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
85+
bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
86+
bot_branch: {{ branch.name | match(list=['renovate/']) | some }}

docs/downloads/gitstream-bb.cm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,5 @@ is:
5858
docs: {{ files | allDocs }}
5959
tests: {{ files | allTests }}
6060
image: {{ files | allImages }}
61-
bot: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
61+
bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
62+
bot_branch: {{ branch.name | match(list=['renovate/']) | some }}

docs/downloads/gitstream.cm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,5 @@ is:
9292
docs: {{ files | allDocs }}
9393
tests: {{ files | allTests }}
9494
image: {{ files | allImages }}
95-
bot: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
95+
bot_author: {{ pr.author | match(list=['github-actions', '_bot_', '[bot]', 'dependabot']) | some }}
96+
bot_branch: {{ branch.name | match(list=['renovate/']) | some }}

0 commit comments

Comments
 (0)