Skip to content

Commit e4b8727

Browse files
authored
Merge pull request #666 from linear-b/add-describe-changes-action
Update automation-actions with describe-changes
2 parents 99291de + 4c1a224 commit e4b8727

File tree

1 file changed

+59
-26
lines changed

1 file changed

+59
-26
lines changed

docs/automation-actions.md

Lines changed: 59 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ For all other actions, gitStream executes the actions in the order they are list
3030
- [`approve`](#approve) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
3131
- [`close`](#close) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
3232
- [`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: -->
3334
- [`explain-code-experts`](#explain-code-experts) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
3435
- [`merge`](#merge) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
3536
- [`request-changes`](#request-changes) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
@@ -245,31 +246,6 @@ automations:
245246
comment: "Please make sure this change request is documented before merging"
246247
```
247248

248-
#### `explain-code-experts` :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
249-
250-
This action, shall add a comment with codeExperts suggestion. If the comment already exists, the comment shall be edited.
251-
252-
<div class="filter-details" markdown=1>
253-
254-
| Args | Usage | Type | Description |
255-
| -----------|------|-----|------------------------------------------------ |
256-
| `lt` | Optional | Integer | Filter the user list, keeping those below the specified threshold |
257-
| `gt` | Optional | Integer | Filter the user list, keeping those above the specified threshold |
258-
| `verbose` | Optional| Bool | When set to false then only shows the suggestion summary and skips the per file details (true by default) |
259-
260-
</div>
261-
262-
```yaml+jinja title="example"
263-
automations:
264-
code_experts:
265-
if:
266-
- true
267-
run:
268-
- action: explain-code-experts@v1
269-
args:
270-
gt: 10
271-
```
272-
273249
#### `approve` :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
274250

275251
This action, once triggered, approves the PR for merge.
@@ -305,7 +281,7 @@ automations:
305281

306282
#### `code-review` :fontawesome-brands-github: <!-- >:fontawesome-brands-gitlab: :fontawesome-brands-bitbucket: -->
307283

308-
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.
284+
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.
309285

310286
<div class="filter-details" markdown=1>
311287

@@ -333,6 +309,63 @@ automations:
333309
APPROVE_PR_ON_LGTM: false # Add conditions for PR approvals. For example - allow approval only for specific users
334310
```
335311

312+
#### `describe-changes` :fontawesome-brands-github:
313+
314+
This action, once triggered, leverages AI to generate a comprehensive summary of the changes in the PR and incorporates it into the PR description.
315+
316+
The action automatically analyzes the code modifications to create a clear, high-level overview of what has been changed, making it easier for reviewers to understand the scope and purpose of the PR.
317+
318+
<div class="filter-details" markdown=1>
319+
320+
| Args | Usage | Type | Description |
321+
| ------------ | -------- | ------ | --------------------------------------------------------------------------------------------------------------------------- |
322+
| `concat_mode` | Optional | String | By default `replace`. The mode to add the changes description, can be `replace`, `append`, or `prepend` to the PR description |
323+
324+
</div>
325+
326+
```yaml+jinja title="example"
327+
automations:
328+
pr_description:
329+
# trigger it only when PR is created or has new commits.
330+
on:
331+
- pr_created
332+
- commit
333+
# Skip description for Draft PRs and PRs from bots.
334+
if:
335+
- {{ not pr.draft }}
336+
- {{ pr.author | match(list=['github-actions', 'dependabot', '[bot]']) | nope }}
337+
run:
338+
- action: describe-changes@v1
339+
args:
340+
concat_mode: append
341+
```
342+
343+
#### `explain-code-experts` :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
344+
345+
This action, shall add a comment with codeExperts suggestion. If the comment already exists, the comment shall be edited.
346+
347+
<div class="filter-details" markdown=1>
348+
349+
| Args | Usage | Type | Description |
350+
| -----------|------|-----|------------------------------------------------ |
351+
| `lt` | Optional | Integer | Filter the user list, keeping those below the specified threshold |
352+
| `gt` | Optional | Integer | Filter the user list, keeping those above the specified threshold |
353+
| `verbose` | Optional| Bool | When set to false then only shows the suggestion summary and skips the per file details (true by default) |
354+
355+
</div>
356+
357+
```yaml+jinja title="example"
358+
automations:
359+
code_experts:
360+
if:
361+
- true
362+
run:
363+
- action: explain-code-experts@v1
364+
args:
365+
gt: 10
366+
```
367+
368+
336369
#### `merge` :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
337370

338371
Once triggered, merge the PR if possible. It can be set to wait for all checks to pass or only required ones.

0 commit comments

Comments
 (0)