Skip to content

Commit

Permalink
Merge pull request #436 from linear-b/zapier-integration
Browse files Browse the repository at this point in the history
Zapier integration Page
  • Loading branch information
BenLloydPearson authored Jan 23, 2024
2 parents 1ca09e1 + efa3fd1 commit ec0d9dc
Show file tree
Hide file tree
Showing 29 changed files with 595 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: Automation - Automatic Slack Messages
description: Automatically post positive recognition messages in Slack for well-structured PRs.
---
# Automatic Slack Messages

<!-- --8<-- [start:example]-->
Automatically post positive recognition messages in Slack for well-structured PRs.

<div class="automationImage" markdown="1">
![Automatic Slack Messages](/automations/integrations/slack/slack-auto-recognition/slack-auto-recognition.png)
</div>
<div class="automationDescription" markdown="1">
!!! info "Configuration Description"
Conditions (all must be true):

* The PR contains updates to tests.
* The PR has fewer than 5 modified files.
* The PR branch references a Jira ticket.
* The PR has fewer than 150 lines of code changed.

Automation Actions:

* Post a Slack message that automatically recognizes the PR author and provides a link to the PR.

</div>
<div class="automationExample" markdown="1">
!!! example "Automatic Slack Messages"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/slack/slack_auto_recognition.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/slack/slack_auto_recognition.cm){ .md-button }
</span>
</div>
</div>
<!-- --8<-- [end:example]-->

## Additional Resources

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

--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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Automation - Send Slack Notifications
description: Automatically send Slack notifications from your git repos with gitStream.
---
# Send Slack Notifications

<!-- --8<-- [start:example]-->
Automatically send Slack notifications to specific channels based on the contents of a pull request.

<div class="automationImage" markdown="1">
![Send Slack Notifications](/automations/integrations/slack/slack-send-notification/slack-send-notification.png)
</div>
<div class="automationDescription" markdown="1">
!!! info "Configuration Description"
Conditions (all must be true):

* The PR meets one or more of the specified trigger criteria for Slack notifications.

Automation Actions:

* Post a Slack message based on the contents of the PR.

</div>
<div class="automationExample" markdown="1">
!!! example "Send Slack Notifications"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/slack/slack_send_notification.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/slack/slack_send_notification.cm){ .md-button }
</span>
</div>
</div>
<!-- --8<-- [end:example]-->

## Additional Resources

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

--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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Automation - Create Project Management Tasks Via Zapier
description: Automatically export new PR titles, description, and url to Zapier.
---
# Create Project Management Tasks Via Zapier

<!-- --8<-- [start:example]-->
Export new PR titles, description, and URL to Zapier.

!!! info "Configuration Description"
Conditions (all must be true):

* A PR is created.

Automation Actions:

* gitStream sends a webhook to Zapier that contains the PR title, description, and URL.

<div class="automationExample" markdown="1">
!!! example "Create Project Management Tasks Via Zapier"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/zapier/zapier_export_pr_description_title_url.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/zapier/zapier_export_pr_description_title_url.cm){ .md-button }
</span>
</div>
</div>
<!-- --8<-- [end:example]-->

## Additional Resources

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

--8<-- "docs/snippets/automation-footer.md"
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Automation - Export PR Number, Title, and URL to Zapier
description: Automatically export data from your git repo to Zapier.
---
# Export PR Number, Title, and URL to Zapier

<!-- --8<-- [start:example]-->
Export new PR titles, numbers, and URLs to Zapier.

!!! info "Configuration Description"
Conditions (all must be true):

* A PR is created.

Automation Actions:

* gitStream sends the PR number, title, and URL to Zapier via webhook.

<div class="automationExample" markdown="1">
!!! example "Export PR Number, Title, and URL to Zapier"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/zapier/zapier_export_pr_number_title_url.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/zapier/zapier_export_pr_number_title_url.cm){ .md-button }
</span>
</div>
</div>
<!-- --8<-- [end:example]-->

## Additional Resources

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

--8<-- "docs/snippets/automation-footer.md"
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Automation - Export PR Data to Zapier
description: Automatically export data from your git repo to Zapier.
---
# Export PR Data to Zapier

<!-- --8<-- [start:example]-->
This is an example of how to send data from gitStream to Zapier.

!!! info "Configuration Description"
Conditions (all must be true):

* A PR is created.

Automation Actions:

* gitStream sends a webhook to Zapier that contains the PR number

<div class="automationExample" markdown="1">
!!! example "Export PR Number to Zapier"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/zapier/zapier_export_pr_number.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/zapier/zapier_export_pr_number.cm){ .md-button }
</span>
</div>
</div>
<!-- --8<-- [end:example]-->

## Additional Resources

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

--8<-- "docs/snippets/automation-footer.md"
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Automation - Auto-Schedule Sync Meetings via Zapier
description: Automatically export data from your git repo to Zapier.
---
# Auto-Schedule Sync Meetings via Zapier

<!-- --8<-- [start:example]-->
Automatically update Zapier with a list of PR reviewers.

!!! info "Configuration Description"
Conditions (all must be true):

* A PR is created or updated.

Automation Actions:

* gitStream sends the list of reviewers to Zapier via webooks.

<div class="automationExample" markdown="1">
!!! example "Auto-Schedule Sync Meetings via Zapier"
```yaml+jinja
--8<-- "docs/downloads/automation-library/integrations/zapier/zapier_export_pr_reviewers.cm"
```
<div class="result" markdown>
<span>
[:octicons-download-24: Download this example as a CM file.](/downloads/automation-library/integrations/zapier/zapier_export_pr_reviewers.cm){ .md-button }
</span>
</div>
</div>
<!-- --8<-- [end:example]-->

## Additional Resources

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

--8<-- "docs/snippets/automation-footer.md"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- mode: yaml -*-

manifest:
version: 1.0

automations:
slack_auto_recognition:
if:
- {{ files | match(regex=r/(test|spec)/) | some }} # this pr has at least 1 test
- {{ files | length <= 5 }} # this pr has 5 or less files
- {{ branch.name | includes(regex=r/[A-Z]{2,}-\d+.*/) }} # this branch has the Jira ticket prefix
- {{ branch.diff.size <= 150 }} # this branch has 150 lines of code or less changed
run:
- action: send-slack-message@v1
args:
webhook_url: "{{ env.SLACK_WEBHOOK }}"
message: ":tada: Congrats to {{ pr.author }} for the amazing new PR, '{{ pr.title }}'! Check it out at https://github.com/{{ repo.owner }}/{{ repo.name }}/pull/{{ pr.number }}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- mode: yaml -*-

manifest:
version: 1.0

automations:
send_slack_security:
if:
# use your custom logic here to determine whether this needs a security review
- true
run:
- action: send-slack-message@v1
args:
webhook_url: "{{ env.SLACK_WEBHOOK_SECURITY }}"
message: "A PR requires a security review. See https://github.com/{{ repo.owner }}/{{ repo.name }}/pull/{{ pr.number }}"
send_slack_qa:
if:
# use your custom logic here to determine whether this needs a qa review
- {{ not (files | match(regex=r/(test|spec)/) | some) }}
run:
- action: send-slack-message@v1
args:
webhook_url: "{{ env.SLACK_WEBHOOK_QA }}"
message: "A PR was submitted without tests. See https://github.com/{{ repo.owner }}/{{ repo.name }}/pull/{{ pr.number }}"
send_slack_docs:
if:
# use your custom logic here to determine whether this needs a docs review
- {{ files | match(regex=r/(docs)/) | some }}
run:
- action: send-slack-message@v1
args:
webhook_url: "{{ env.SLACK_WEBHOOK_DOCS }}"
message: "A PR has modified the docs. See https://github.com/{{ repo.owner }}/{{ repo.name }}/pull/{{ pr.number }}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- mode: yaml -*-

manifest:
version: 1.0

pr_url: "https://github.com/{{ repo.owner }}/{{ repo.name }}/pull/{{ pr.number }}"

on:
- pr_created

automations:
zapier_export_pr_description_title_url:
if:
- true
run:
- action: send-http-request@v1
args:
url: "{{ ZAPIER_WEBHOOK }}"
method: POST
headers: '{"Content-type": "application/json"}'
body: '{ "pr_description":"{{ pr.description }}", "pr_title":"{{ pr.title }}", "pr_url":"{{ pr_url }}" }'
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- mode: yaml -*-

manifest:
version: 1.0

automations:
zapier_export_pr_number:
if:
- true
run:
- action: send-http-request@v1
args:
url: "{{ ZAPIER_WEBHOOK }}"
method: POST
headers: '{"Content-type": "application/json"}'
body: '{ "pr_number":"{{ pr.number }}" }'
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- mode: yaml -*-

manifest:
version: 1.0

pr_url: "https://github.com/{{ repo.owner }}/{{ repo.name }}/pull/{{ pr.number }}"

on:
- pr_created

automations:
zapier_export_pr_number_title_url:
if:
- true
run:
- action: send-http-request@v1
args:
url: "{{ ZAPIER_WEBHOOK }}"
method: POST
headers: '{"Content-type": "application/json"}'
body: '{ "pr_number":"{{ pr.number }}", "pr_title":"{{ pr.title }}", "pr_url":"{{ pr_url }}" }'
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- mode: yaml -*-

manifest:
version: 1.0

pr_url: "https://github.com/{{ repo.owner }}/{{ repo.name }}/pull/{{ pr.number }}"

automations:
zapier_export_pr_reviewers:
if:
- true
run:
- action: send-http-request@v1
args:
url: "{{ env.ZAPIER_WEBHOOK }}"
method: "POST"
headers: '{"Content-type": "application/json"}'
body: '{ "reviewers": "{{ pr.reviewers }}" }'
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ec0d9dc

Please sign in to comment.