Skip to content

Commit

Permalink
Merge pull request #431 from linear-b/dependency-integrations
Browse files Browse the repository at this point in the history
Snyk and Renovate integration pages and improvements to Dependabot integration
  • Loading branch information
vim-zz committed Jan 21, 2024
2 parents 0c14e9d + b638e98 commit 6d0c8f5
Show file tree
Hide file tree
Showing 12 changed files with 222 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,63 @@ title: gitStream Automation - Approve and Merge Dependabot Changes
description: Automatically approve and merge Dependabot PRs.
---
# Approve and Merge Dependabot Changes
<!-- --8<-- [start:example]-->
Auto-merge Dependabot PRs

Approve PRs from Dependabot
=== "All Updates"
!!! info "Configuration Description"

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

* The PR author is Dependabot.
* The branch name includes 'dependabot'
* The PR author is Dependabot.
* The branch name includes 'dependabot'

Automation Actions:
Automation Actions:

* Approve the PR
* Apply an `approved-dependabot` label to the PR
* Merge the PR if all status checks pass.
* Approve the PR
* Apply an `approved-dependabot` label to the PR
* Merge the PR if all status checks pass.


!!! example "Approve Dependabot"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/dependabot/approve_dependabot.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/dependabot/approve_dependabot.cm){ .md-button }
</span>
</div>
!!! example "Configuration Example"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/dependabot/approve_dependabot.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/dependabot/approve_dependabot.cm){ .md-button }
</span>
</div>

=== "By Release Type"

!!! warning "Required gitStream Plugins"
This example requires you to install the [`extractDependabotVersionBump`](/filter-function-plugins/#extractdependabotversionbump) and [compareSemver](http://127.0.0.1:8000/filter-function-plugins/#comparesemver) plugins.
[Learn more about gitStream plugins](/plugins/).

!!! info "Configuration Description"

Conditions (all must be true):

* The PR author is Dependabot.
* The branch name includes 'dependabot'
* The dependency change is a patch or minor update.

Automation Actions:

* Approve the PR
* Apply an `approved-dependabot` label to the PR
* Merge the PR if all status checks pass.

!!! example "Configuration Example"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/dependabot/approve_dependabot_minor.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/dependabot/approve_dependabot_minor.cm){ .md-button }
</span>
</div>

<!-- --8<-- [end:example]-->
35 changes: 35 additions & 0 deletions docs/automations/integrations/renovate/approve-renovate/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: gitStream Automation - Approve and Merge Renovate Changes
description: Automatically approve and merge Renovate PRs.
---
# Approve and Merge Renovate Changes

<!-- --8<-- [start:example]-->
Approve PRs from Renovate

![Approve and Merge Renovate Changes](/automations/integrations/renovate/approve-renovate/approve-renovate.png)

!!! info "Configuration Description"

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

* The PR author is Mend Renovate.

**Automation Actions:**

* Approve the PR
* Apply an `approved-renovate` label to the PR
* Merge the PR if all status checks pass.

<div class="automationExample" markdown="1">
!!! example "Approve Renovate"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/renovate/approve-renovate/approve_renovate.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/renovate/approve-renovate/approve_renovate.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.
35 changes: 35 additions & 0 deletions docs/automations/integrations/snyk/approve-snyk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: gitStream Automation - Approve and Merge Snyk Changes
description: Automatically approve and merge Snyk PRs.
---
# Approve and Merge Snyk Changes

<!-- --8<-- [start:example]-->
Approve PRs from Snyk

![Approve and Merge Snyk Changes](/automations/integrations/snyk/approve-snyk/approve-snyk.png)

!!! info "Configuration Description"

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

* The PR author is Snyk.

**Automation Actions:**

* Approve the PR
* Apply an `approved-snyk` label to the PR
* Merge the PR if all status checks pass.

<div class="automationExample" markdown="1">
!!! example "Approve Snyk"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/snyk/approve-snyk/approve_snyk.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/snyk/approve-snyk/approve_snyk.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,29 @@
manifest:
version: 1.0

automations:
merge_dependabot_minor:
if:
- {{ bump == 'minor' }}
- {{ branch.name | includes(term="dependabot") }}
- {{ branch.author | includes(term="dependabot") }}
run:
- action: approve@v1
- action: add-comment@v1
args:
comment: |
Dependabot `minor` version bumps are approved automatically.
merge_dependabot_minor_patch:
if:
- {{ bump == 'patch' }}
- {{ branch.name | includes(term="dependabot") }}
- {{ branch.author | includes(term="dependabot") }}
run:
- action: approve@v1
- action: merge@v1
- action: add-comment@v1
args:
comment: |
Dependabot `patch` version bumps are approved and merged automatically.

bump: {{ pr.description | extractDependabotVersionBump | compareSemver }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- mode: yaml -*-

manifest:
version: 1.0

automations:
approve_renovate:
if:
- {{ branch.author | includes(term="renovate") }}
run:
- action: approve@v1
- action: add-label@v1
args:
label: "approved-renovate"
- action: merge@v1
args:
wait_for_all_checks: true
squash_on_merge: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- mode: yaml -*-

manifest:
version: 1.0

automations:
approve_snyk:
if:
- {{ branch.author | includes(term="snyk") }}
run:
- action: approve@v1
- action: add-label@v1
args:
label: "approved-snyk"
- action: merge@v1
args:
wait_for_all_checks: true
squash_on_merge: true
12 changes: 12 additions & 0 deletions docs/integrations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,18 @@ description: Integrate third-party developer tools with gitStream.
</div>
</div>

<div class="integrations-card" markdown="1">
<div class="integrations-card-title" markdown="1">
[:simple-renovatebot: Renovate](/integrations/renovate)
</div>
</div>

<div class="integrations-card" markdown="1">
<div class="integrations-card-title" markdown="1">
[:simple-snyk: Snyk](/integrations/snyk)
</div>
</div>

</div>

## Project Management
Expand Down
8 changes: 7 additions & 1 deletion docs/integrations/dependabot.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@ description: Use gitStream to automatically approve and merge Dependabot PRs.
# Integrate gitStream with Dependabot

## Approve and Merge Dependabot Changes
--8<-- "docs/automations/integrations/dependabot/approve-dependabot/README.md:6:"
--8<-- "docs/automations/integrations/dependabot/approve-dependabot/README.md:example"

## Additional Resources

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

--8<-- "docs/snippets/automation-footer.md"
9 changes: 9 additions & 0 deletions docs/integrations/renovate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Integrate gitStream with Mend Renovate
description: Implement workflow automations for Mend Renovate.
---
# Integrate gitStream with Mend Renovate

<a name="approve-renovate"></a>
## Auto-Merge Renovate Dependency Updates
--8<-- "docs/automations/integrations/renovate/approve-renovate/README.md:example"
9 changes: 9 additions & 0 deletions docs/integrations/snyk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Integrate gitStream with Snyk
description: Implement workflow automations for Snyk.
---
# Integrate gitStream with Snyk

<a name="approve-snyk"></a>
## Auto-Merge Snyk Dependency Updates
--8<-- "docs/automations/integrations/snyk/approve-snyk/README.md:example"

0 comments on commit 6d0c8f5

Please sign in to comment.