Skip to content

Commit

Permalink
Merge pull request #565 from linear-b/add-generate-pr-desc-automation
Browse files Browse the repository at this point in the history
added section for Generate PR Description
  • Loading branch information
vim-zz authored Aug 8, 2024
2 parents 8f76070 + 742c7a9 commit 60f70a3
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 1 deletion.
49 changes: 49 additions & 0 deletions docs/automations/generate-pr-description/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Automation - Generate PR Description from Commit Messages
description: Automatically generate Pull Request descriptions based on commit messages.
category: [quality, productivity]
---
# Automatically Generate PR Description from Commit Messages

Automatically generate Pull Request descriptions based on commit messages. This automation helps ensure PR descriptions are consistent and informative.

!!! warning "Required gitStream Plugins"
This example requires you to install the [`generateDescription`](/filter-function-plugins/#generatedescription) plugin.

[Learn more about gitStream plugins](/plugins/).

<div class="automationImage" style="align:right" markdown="1">
![Automatically generate PR descriptions](generate-pr-description-example.png)
</div>
<div class="automationDescription" markdown="1">
!!! info "Configuration Description"
Conditions (all must be true):

* A PR is created or has commits added to it.

Automation Actions:

* Update the PR description with auto-generated content based on commit messages.
</div>
<div class="automationExample" markdown="1">
!!! example "Generate PR Description"
```yaml+jinja
--8<-- "docs/downloads/automation-library/generate_pr_description.cm.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/generate_pr_description.cm.cm"){ .md-button }
</span>
</div>
</div>

## Additional Resources

--8<-- "docs/snippets/general.md"

**Related Automations**:

--8<-- "docs/snippets/context-automation.md::2"
--8<-- "docs/snippets/context-automation.md:4:"

--8<-- "docs/snippets/automation-footer.md"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion plugins/filters/generateDescription/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

??? example "gitStream CM Example: generateDescription"
```yaml+jinja
--8<-- "plugins/filters/generateDescription/auto_pr_description.cm"
--8<-- "plugins/filters/generateDescription/generate_pr_description.cm.cm"
```
<div class="result" markdown>
<span>
Expand Down
14 changes: 14 additions & 0 deletions plugins/filters/generateDescription/generate_pr_description.cm.cm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
triggers:
exclude:
branch:
- r/dependabot/

automations:
generate_pr_desc:
if:
- true
run:
- action: update-description@v1
args:
description: |
{{ branch | generateDescription(pr, repo, source) }}

0 comments on commit 60f70a3

Please sign in to comment.