Skip to content

Commit b4609ed

Browse files
authored
Merge pull request #676 from linear-b/update-ai-actions
Update AI actions with all providers, template and guidelines
2 parents 852a28e + 6e2f208 commit b4609ed

File tree

1 file changed

+27
-4
lines changed

1 file changed

+27
-4
lines changed

docs/automation-actions.md

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ For all other actions, gitStream executes the actions in the order they are list
2929
- [`add-thread`](#add-thread) :fontawesome-brands-gitlab:
3030
- [`approve`](#approve) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
3131
- [`close`](#close) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
32-
- [`code-review`](#code-review) :fontawesome-brands-github: <!-- :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket: -->
33-
- [`describe-changes`](#describe-changes) :fontawesome-brands-github: <!-- :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket: -->
32+
- [`code-review`](#code-review) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
33+
- [`describe-changes`](#describe-changes) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
3434
- [`explain-code-experts`](#explain-code-experts) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
3535
- [`merge`](#merge) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
3636
- [`request-changes`](#request-changes) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
@@ -279,7 +279,7 @@ automations:
279279
- action: close@v1
280280
```
281281

282-
#### `code-review` :fontawesome-brands-github: <!-- >:fontawesome-brands-gitlab: :fontawesome-brands-bitbucket: -->
282+
#### `code-review` :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
283283

284284
This action, once triggered, reviews the code in the PR, and generates a comment with the identified issue, bugs, misconfigurations, and bad practices in the newly introduced code, with an option to approve the PR if no issues were found.
285285

@@ -288,6 +288,7 @@ This action, once triggered, reviews the code in the PR, and generates a comment
288288
| Args | Usage | Type | Description |
289289
| -----------|------|-----|------------------------------------------------ |
290290
| `approve_on_LGTM` | Optional | Bool | Approve this PR if no issues were found. Default is `false` |
291+
| `guidelines` | Optional | String | Provides custom instructions to the AI model to tailor the generated description. |
291292

292293
```yaml+jinja title="example"
293294
automations:
@@ -302,14 +303,18 @@ automations:
302303
- action: code-review@v1
303304
args:
304305
approve_on_LGTM: {{ APPROVE_PR_ON_LGTM }} # optional arg, you can remove it
306+
guidelines: {{ GUIDELINES | dump }}
305307
...
306308
...
307309
# Define variables
308310
309311
APPROVE_PR_ON_LGTM: false # Add conditions for PR approvals. For example - allow approval only for specific users
312+
GUIDELINES: |
313+
- Don't comment on using outdated dependencies
314+
310315
```
311316

312-
#### `describe-changes` :fontawesome-brands-github:
317+
#### `describe-changes` :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
313318

314319
This action, once triggered, leverages AI to generate a comprehensive summary of the changes in the PR and incorporates it into the PR description.
315320

@@ -320,10 +325,17 @@ The action automatically analyzes the code modifications to create a clear, high
320325
| Args | Usage | Type | Description |
321326
| ------------ | -------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
322327
| `concat_mode` | Optional | String | By default `replace`. The mode to add the changes description, can be `replace`, `append`, or `prepend` to the PR description |
328+
| `guidelines` | Optional | String | Provides custom instructions to the AI model to tailor the generated description. |
329+
| `template` | Optional | String | Specifies a template for the AI model to use and fill in when generating the PR description. |
323330

324331
</div>
325332

326333
```yaml+jinja title="example"
334+
# -*- mode: yaml -*-
335+
336+
manifest:
337+
version: 1.0
338+
327339
automations:
328340
linearb_ai_description:
329341
# trigger it only when PR is created or has new commits
@@ -338,6 +350,17 @@ automations:
338350
- action: describe-changes@v1
339351
args:
340352
concat_mode: append
353+
guidelines: {{ GUIDELINES }}
354+
template: {{ TEMPLATE }}
355+
356+
GUIDELINES: |
357+
Remove all unnecessary checkboxes.
358+
Try to extract the Jira ticket from "{{ branch.name }}" or "{{ pr.title }}" and fill it into the template.
359+
Jira ticket should be in format ABC-12345.
360+
361+
# Load the PR template content from a file in the repository
362+
TEMPLATE: {{ ".github/PULL_REQUEST_TEMPLATE.md" | readFile() | dump }}
363+
341364
```
342365

343366
#### `explain-code-experts` :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:

0 commit comments

Comments
 (0)