Skip to content
Open
Changes from 3 commits
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
62 changes: 62 additions & 0 deletions .github/workflows/send-notification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: "Send notification"
on:
pull_request:
types: [closed]
jobs:
send_notification:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
strategy:
matrix:
include:
- webhook: SLACK_WEBHOOK_URL1
- webhook: SLACK_WEBHOOK_URL2

env:
SLACK_WEBHOOK_URL1: ${{ secrets.SLACK_WEBHOOK_URL1 }}
SLACK_WEBHOOK_URL2: ${{ secrets.SLACK_WEBHOOK_URL2 }}

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v32

- name: Check if mainnet or testnet were changed
if: contains(steps.changed-files.outputs.all_changed_files, 'shared-config-mainnet.json') || contains(steps.changed-files.outputs.all_changed_files, 'shared-config-test.json')
run: |
echo "environment_changed=true" >> $GITHUB_ENV

- name: Send Slack notification
uses: 8398a7/action-slack@v3
if: ${{ env.environment_changed }}
with:
status: custom
fields: all
custom_payload: |
{
text: `Changes have been detected.\nPlease restart your relayer(s) on the changed environment.\n\n If a new network was added with these changes, you will have to expand your local relayer(s) configuration.\n\n For more details feel free to contact the Sygma team.`,
attachments: [{
color: 'good',
fields: [
{
title: 'Repository',
value: `${ process.env.AS_REPO }`,
},
{
title: 'Pull request',
value: `${ process.env.AS_PULL_REQUEST }`,
},
{
title: 'Author',
value: `${ process.env.AS_AUTHOR }`,
},
],
}]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets[matrix.webhook] }}