Skip to content

Commit

Permalink
Merge branch 'main' into custom-github-app
Browse files Browse the repository at this point in the history
  • Loading branch information
vim-zz authored Jun 26, 2024
2 parents a073215 + dd63ff9 commit f124d10
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 12 deletions.
40 changes: 39 additions & 1 deletion docs/automation-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ For all other actions, gitStream executes the actions in the order they are list
- [`send-slack-message`](#send-slack-message) :fontawesome-solid-flask: :fontawesome-brands-github:
- [`set-required-approvals`](#set-required-approvals) :fontawesome-brands-github:
- [`update-description`](#update-description) :fontawesome-brands-github:
- [`update-title`](#update-title) :fontawesome-brands-github:

!!! note

Expand Down Expand Up @@ -484,9 +485,46 @@ automations:
args:
concat_mode: prepend
description: |
{{ pr.title | capture(regex=r/\b[A-Za-z]+-\d+\b/) }}
{{ jira_ticket_from_title }}
has:
jira_ticket_in_title: {{ pr.title | includes(regex=r/\b[A-Za-z]+-\d+\b/) }}
jira_ticket_in_desc: {{ pr.description | includes(regex=r/atlassian.net\/browse\/\w{1,}-\d{3,4}/) }}
jira_ticket_from_title: {{ pr.title | capture(regex=r/\b[A-Za-z]+-\d+\b/) }}
```


#### `update-title` :fontawesome-brands-github:
This action, when triggered, updates the PR title with new content.

This is a managed action. When a PR updates, the existing comments that were added by gitStream are re-evaluated, and those that are not applicable are removed.

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

| Args | Usage | Type | Description |
| -----------|-------|-----------|----------------------------------------- |
| `title` | Required | String | Sets the PR title |
| `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 title with the ticket info if present in the PR title.

```yaml+jinja title="example"
automations:
add_jira_to_title:
if:
- {{ has.jira_ticket_in_desc and (not has.jira_ticket_in_title) }}
run:
- action: update-title@v1
args:
concat_mode: prepend
title: |
{{ jira_ticket_from_desc }} -
has:
jira_ticket_in_title: {{ pr.title | includes(regex=r/\b[A-Za-z]+-\d+\b/) }}
jira_ticket_in_desc: {{ pr.description | includes(regex=r/atlassian.net\/browse\/\w{1,}-\d{3,4}/) }}
jira_ticket_from_desc: {{ pr.description | capture(regex=r/\b[A-Za-z]+-\d+\b/) }}
```
2 changes: 1 addition & 1 deletion docs/automations/approve-tests/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Automation - Approve test changes
description: Automatically approve changes that only contain updates to tests.
category: [efficiency, testing, quickstart]
category: [efficiency, testing]
quickstart: true
---
# Approve test changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Automation - Label GitHub Copilot PRs
description: Automatically apply labels to PRs that are assisted by GitHub Copilot
category: [quality, genai, copilot]
category: [quality, genai, copilot, quickstart]
---
# Automatically Label GitHub Copilot PRs
<!-- --8<-- [start:example]-->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Automation - Approve and Merge Dependabot Changes
description: Automatically approve and merge Dependabot PRs.
category: [efficiency, dependabot, security]
category: [efficiency, dependabot, security, quickstart]
quickstart: false
---
# Approve and Merge Dependabot Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Automation - Review Orca Security Alerts
description: Automatically require review from your SecOps team for Orca Security violations in pull requests.
category: [security, orca, quickstart]
category: [security, orca]
quickstart: true
---
# Require Security Review for Orca Alerts
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Automation - Approve and Merge Renovate Changes
description: Automatically approve and merge Renovate PRs.
category: [efficiency, renovate, security]
category: [efficiency, renovate, security, quickstart]
quickstart: false
---
# Approve and Merge Renovate Changes
Expand Down
2 changes: 1 addition & 1 deletion docs/automations/integrations/sonar/label-sonar/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Automation - Label SonarCloud Quality Reports
description: Automatically label PRs with SonarCloud insights.
category: [security, sonarcloud, quickstart]
category: [security, sonarcloud]
quickstart: true
---
# Label SonarCloud Quality Reports
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Automation - Provide Estimated Time to Review
description: Automatically label PRs with an estimated time to review.
category: [efficiency, review, quickstart]
category: [efficiency, review]
quickstart: true
---
# Provide Estimated Time to Review
Expand Down
2 changes: 1 addition & 1 deletion docs/automations/request-screenshot/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Automation - Request Screenshot
description: Automatically ensure PRs contain screenshots to help illustrate the changes.
category: [quality, review]
category: [quality, review, quickstart]
---
# Request Screenshot
If the PR lacks an image file, or link to an image in the description, apply a `no-screenshot` label and post a comment to request a screenshot. If the PR author updates the description, gitStream will remove the label.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Automation - Label Unresolved Review Threads
description: Automatically label PRs when there are unresolved code review comments.
category: [security, quickstart]
category: [security]
quickstart: true
---
# Label Unresolved Review Threads
Expand Down
2 changes: 1 addition & 1 deletion docs/automations/standard/link-issue-tracker/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Automation - Automatic Project Tracker Links
description: Automatically post PR comments that link to the associated project tracking resource.
category: [quality, quickstart]
category: [quality]
quickstart: true
---

Expand Down
2 changes: 1 addition & 1 deletion docs/automations/welcome-newcomer/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Automation - Welcome Newcomer
description: Automatically post messages to first time PR contributors to help them get started.
category: [review, quickstart]
category: [review]
quickstart: true
---
# Welcome Newcomer
Expand Down

0 comments on commit f124d10

Please sign in to comment.