Skip to content

Commit fcd0e33

Browse files
authored
docs: Add change-pr-state automation action documentation (#839)
* docs: Add change-pr-state automation action documentation - Add change-pr-state action to overview list - Document action parameters and usage - Include example for converting draft PRs to ready for review - Supports GitHub and GitLab platforms Relates to LINBEE-21553 * docs: Add explicit triggers requirement note for change-pr-state - Add informational note explaining gitStream doesn't run on draft PRs by default - Link to execution model documentation for explicit triggers - Update example comment for clarity Since gitStream does not evaluate draft PRs by default, users must configure explicit triggers (using the 'on' parameter) for automations that use the change-pr-state action to function properly.
1 parent 842abd3 commit fcd0e33

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

docs/automation-actions.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ For all other actions, gitStream executes the actions in the order they are list
2828
- [`add-reviewers`](#add-reviewers) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
2929
- [`add-thread`](#add-thread) :fontawesome-brands-gitlab:
3030
- [`approve`](#approve) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
31+
- [`change-pr-state`](#change-pr-state) :fontawesome-brands-github: :fontawesome-brands-gitlab:
3132
- [`close`](#close) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
3233
- [`code-review`](#code-review) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
3334
- [`describe-changes`](#describe-changes) :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
@@ -261,6 +262,36 @@ automations:
261262
- action: approve@v1
262263
```
263264

265+
#### `change-pr-state` :fontawesome-brands-github: :fontawesome-brands-gitlab:
266+
267+
This action, once triggered, updates the PR state between draft and ready for review.
268+
269+
!!! note "Explicit Triggers Required for Draft PRs"
270+
Since gitStream does not run on draft PRs by default, this action requires the use of [explicit triggers](execution-model.md#explicit-triggers) to function properly. Define triggers using the `on` parameter at the automation level to specify when the automation should evaluate draft PRs.
271+
272+
<div class="filter-details" markdown=1>
273+
274+
| Args | Usage | Type | Description |
275+
| --- | --- | --- | --- |
276+
| `draft` | Optional | Bool | When `true`, convert the PR to Draft. When `false`, mark the PR as Ready for review. |
277+
278+
</div>
279+
280+
```yaml+jinja title="example"
281+
automations:
282+
ready_for_review:
283+
# Explicit triggers required to work with draft PRs
284+
on:
285+
- label_added
286+
- pr_created
287+
if:
288+
- true
289+
run:
290+
- action: change-pr-state@v1
291+
args:
292+
draft: false
293+
```
294+
264295
#### `close` :fontawesome-brands-github: :fontawesome-brands-gitlab: :fontawesome-brands-bitbucket:
265296

266297
This action, once triggered, closes the PR without merging.

0 commit comments

Comments
 (0)