Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding pr description conventions #440

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
title: gitStream Automation - Enforce PR Description Requirements.
description: Automaticallly request changes for PRs that have empty descriptions.
---
# Enforce PR Description Requirements
<!-- --8<-- [start:example]-->
Automaticallly request changes for PRs that have empty descriptions.

![Enforce PR Description Requirements](/automations/standard/enforce-pr-description-requirements/enforce-pr-description-requirements.png)

!!! info "Configuration Description"

**Conditions (all must be true):**

* The PR description is empty.

**Automation Actions:**

* Request changes and post a comment explaining that PR descriptions are required.

<div class="automationExample" markdown="1">
!!! example "Enforce PR Description Requirements"
```yaml+jinja
--8<-- "docs/downloads/automation-library/standard/enforce-pr-description-requirements/enforce_pr_description_requirements.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/standard/enforce-pr-description-requirements/enforce_pr_description_requirements.cm){ .md-button }
</span>
</div>
<!-- --8<-- [end:example]-->

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/automations/standard/pr-description-checklist/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: gitStream Automation - Block a PR From Merging if the Description Lacks Any Required Checklist Items.
description: Block a PR from merging if the description lacks any required checklist items.
---
# Block a PR From Merging if the Description Lacks Any Required Checklist Items
<!-- --8<-- [start:example]-->
Block a PR from merging if the description lacks any required checklist items.

![PR Description Checklist](/automations/standard/pr-description-checklist/pr-description-checklist.png)

!!! info "Configuration Description"

**Conditions (all must be true):**

* The PR description has one or more unchecked checkboxes.

**Automation Actions:**

* Request changes and post a comment asking the author to complete the PR checklist.
* Apply a yellow “Missing Checklist Items” label.


<div class="automationExample" markdown="1">
!!! example "Block a PR from merging if the description lacks any required checklist items"
```yaml+jinja
--8<-- "docs/downloads/automation-library/standard/pr-description-checklist/pr_description_checklist.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/standard/pr-description-checklist/pr_description_checklist.cm){ .md-button }
</span>
</div>
<!-- --8<-- [end:example]-->

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
manifest:
version: 1.0

automations:
enforce_pr_description_requirements:
if:
- {{ not has.description }}
run:
- action: request-changes@v1
args:
comment: |
Descriptions are required for all PRs. Please update your description to describe what changes this PR introduces and anything else reviewers should be aware of. Please also provide a reference to any relevant project management tracking resources.
has:
description: {{ pr.description | includes(regex=r/[a-zA-Z]/) }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- mode: yaml -*-

manifest:
version: 1.0

automations:
pr_description_checklist:
if:
- {{ pr.description | includes(regex=r/\-\[\]/) }}
run:
- action: add-label@v1
args:
label: "Missing Checklist Items"
color: {{ colors.yellow }}
- action: request-changes@v1
args:
comment: |
Please complete the PR checklist before requesting a code review.

colors:
yellow: 'fbca04'