Skip to content

Commit f76429b

Browse files
authored
Merge pull request #554 from linear-b/add-thread-action
add thread documentation
2 parents 6e335f4 + 0780985 commit f76429b

File tree

1 file changed

+40
-16
lines changed

1 file changed

+40
-16
lines changed

docs/automation-actions.md

Lines changed: 40 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ For all other actions, gitStream executes the actions in the order they are list
2424
- [`add-label`](#add-label) :fontawesome-brands-github: :fontawesome-brands-gitlab:
2525
- [`add-labels`](#add-labels) :fontawesome-brands-github: :fontawesome-brands-gitlab:
2626
- [`add-reviewers`](#add-reviewers) :fontawesome-brands-github: :fontawesome-brands-gitlab:
27+
- [`add-thread`](#add-thread) :fontawesome-brands-gitlab:
2728
- [`approve`](#approve) :fontawesome-brands-github: :fontawesome-brands-gitlab:
2829
- [`close`](#close) :fontawesome-brands-github: :fontawesome-brands-gitlab:
2930
- [`explain-code-experts`](#explain-code-experts) :fontawesome-brands-github: :fontawesome-brands-gitlab:
@@ -167,7 +168,7 @@ This action, once triggered, sets a specific reviewer.
167168
| `team_reviewers` | Optional | [String] | Sets required team reviewers without a prefix `team` |
168169
| `unless_reviewers_set` | Optional | Bool | When `true`, the reviewers are not added if the PR has already assigned reviewers. It is set to `false` by default |
169170
| `fail_on_error` | Optional | Bool | When `true`, trying to assign illegal reviewers shall fail the automation, when `false` these errors are silently ignored. It is set to `true` by default |
170-
| `wait_for_all_checks` :fontawesome-brands-github: | Optional | Boolean | By default `false`. When `true`, the action will add reviewers only if all checks (except gitStream) are completed with `neutral`, `skipped`, or `success` conclusion |
171+
| `wait_for_all_checks` :fontawesome-brands-github: | Optional | Bool | By default `false`. When `true`, the action will add reviewers only if all checks (except gitStream) are completed with `neutral`, `skipped`, or `success` conclusion |
171172

172173
</div>
173174

@@ -183,9 +184,32 @@ automations:
183184
reviewers: [popeye, olive, acme/team-a]
184185
```
185186
!!! warning "Enable Team Write Access"
186-
If you want to assign teams as PR reviewers, you need to first make sure the team has write access to the repo in via your organization's settings. For more info, refer to the GitHub instructions for [managing team review settings](https://docs.github.com/en/organizations/organizing-members-into-teams/managing-code-review-settings-for-your-team).
187+
If you want to assign teams as PR reviewers, you need to first make sure the team has write access to the repo in your organization's settings. For more info, refer to the GitHub instructions for [managing team review settings](https://docs.github.com/en/organizations/organizing-members-into-teams/managing-code-review-settings-for-your-team).
187188

189+
#### `add-thread` :fontawesome-brands-gitlab:
188190

191+
When this action is triggered, a new thread is added to the MR. gitStream can then preserve the thread state after each automation run, including the RESOLVE state and COMMENTS. If the rule's condition doesn't pass, gitStream will remove the thread completely.
192+
193+
<div class="filter-details" markdown=1>
194+
195+
| Args | Usage | Type | Description |
196+
| ------------ | -------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
197+
| `comment` | Required | [String] | The desired thread content |
198+
| `resolvable` | Optional | Bool | By default, `true`. When set to `true`, gitStream will issue the thread once and retain all changes made to it by the user. Therefore, if the thread is resolved, it will stay resolved until the condition no longer applies. When set to `false`, gitStream will re-issue the thread after each automation run until the condition is fixed. |
199+
200+
</div>
201+
202+
203+
```yaml+jinja title="example"
204+
automations:
205+
enforce_documentation:
206+
if:
207+
- true
208+
run:
209+
- action: add-thread@v1
210+
args:
211+
comment: "Please make sure this change request is documented before merging"
212+
```
189213

190214
#### `explain-code-experts` :fontawesome-brands-github: :fontawesome-brands-gitlab:
191215

@@ -251,11 +275,11 @@ Once triggered, merge the PR if possible. It can be set to wait for all checks t
251275

252276
<div class="filter-details" markdown=1>
253277

254-
| Args | Usage | Type | Description |
255-
| -------------------------------------------------- | -------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
256-
| `wait_for_all_checks` :fontawesome-brands-github: | Optional | Boolean | By default `false`, so only Required checks can block merge, when `true` the action will merge after all checks are completed with `neutral`, `skipped`, or `success` conclusion (except gitStream itself) |
257-
| `rebase_on_merge` | Optional | Boolean | By default `false`, when merging use rebase mode |
258-
| `squash_on_merge` | Optional | Boolean | By default `false`, when merging use squash mode |
278+
| Args | Usage | Type | Description |
279+
| -------------------------------------------------- | -------- | ---- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
280+
| `wait_for_all_checks` :fontawesome-brands-github: | Optional | Bool | By default `false`, so only Required checks can block merge, when `true` the action will merge after all checks are completed with `neutral`, `skipped`, or `success` conclusion (except gitStream itself) |
281+
| `rebase_on_merge` | Optional | Bool | By default `false`, when merging use rebase mode |
282+
| `squash_on_merge` | Optional | Bool | By default `false`, when merging use squash mode |
259283

260284
</div>
261285

@@ -339,15 +363,15 @@ This action, once triggered, will start a workflow dispatch automation with the
339363

340364
<div class="filter-details" markdown=1>
341365

342-
| Args | Usage | Type | Description |
343-
| -----------|-------|-----------|----------------------------------------- |
344-
| `workflow` | Required | String | The ID or name of the workflow dispatch. |
345-
| `owner` | Optional | String | By default, the value of `repo.owner` context variable. The account owner of the repository. Case insensitive. |
346-
| `repo` | Optional | String | By default, the value of `repo.name` context variable. The name of the repository without the `.git` extension. Case insensitive. |
347-
| `ref` | Optional | String | By default, the value of `branch.name` context variable. The account owner of the repository. Case insensitive. |
348-
| `inputs` | Optional | String | By default, an empty list. Key-Value list with the arguments to provide to the workflow |
349-
| `check_name` | Optional | String | When added, after the workflow is complete, add the check name to the checks list on GitHub |
350-
| `stop_ongoing_workflow` | Optional | Boolean | By default, `false`. In case the workflow already runs on the branch, if `true`: cancel the ongoing workflow before running the newly dispatched workflow. If `false`: wait for the old workflow to finish before dispatching a new one|
366+
| Args | Usage | Type | Description |
367+
| ----------------------- | -------- | ------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
368+
| `workflow` | Required | String | The ID or name of the workflow dispatch. |
369+
| `owner` | Optional | String | By default, the value of `repo.owner` context variable. The account owner of the repository. Case insensitive. |
370+
| `repo` | Optional | String | By default, the value of `repo.name` context variable. The name of the repository without the `.git` extension. Case insensitive. |
371+
| `ref` | Optional | String | By default, the value of `branch.name` context variable. The account owner of the repository. Case insensitive. |
372+
| `inputs` | Optional | String | By default, an empty list. Key-Value list with the arguments to provide to the workflow |
373+
| `check_name` | Optional | String | When added, after the workflow is complete, add the check name to the checks list on GitHub |
374+
| `stop_ongoing_workflow` | Optional | Bool | By default, `false`. In case the workflow already runs on the branch, if `true`: cancel the ongoing workflow before running the newly dispatched workflow. If `false`: wait for the old workflow to finish before dispatching a new one |
351375

352376
</div>
353377

0 commit comments

Comments
 (0)