Skip to content

Commit

Permalink
Merge pull request #539 from linear-b/update-description-improve
Browse files Browse the repository at this point in the history
concat_mode
  • Loading branch information
vim-zz authored Jun 19, 2024
2 parents 7ead0d7 + 01989fd commit 150da8a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/automation-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ This is a managed action. When a PR updates, the existing comments that were add
| Args | Usage | Type | Description |
| -----------|-------|-----------|----------------------------------------- |
| `description` | Required | String | Sets the PR description |
| `concat_mode` | Optional | String | `replace` by default, the mode to concatenate the new description with the existing one. Possible values: `prepend`, `append`, `replace` |
</div>

For example, this automation updates the PR description with the ticket info if present in the PR title.
Expand All @@ -481,9 +482,9 @@ automations:
run:
- action: update-description@v1
args:
concat_mode: prepend
description: |
{{ pr.title | capture(regex=r/\b[A-Za-z]+-\d+\b/) }}
{{ pr.description }}
has:
jira_ticket_in_title: {{ pr.title | includes(regex=r/\b[A-Za-z]+-\d+\b/) }}
Expand Down

0 comments on commit 150da8a

Please sign in to comment.