Skip to content

Notify slack of an error in case github sync action fails #4

Notify slack of an error in case github sync action fails

Notify slack of an error in case github sync action fails #4

name: Sync branches with main
on:
push:
branches:
- main
jobs:
sync-branches:
runs-on: ubuntu-latest
name: Syncing branches
steps:
- name: Set Git config
uses: actions/checkout@v2
run: |
git config --local user.email "actions@github.com"
git config --local user.name "Github Actions"
- name: Sync testnet with main
run: |
git fetch --unshallow
git checkout testnets
git pull
git merge --no-ff main -m "Auto-merge main into testnet"
git push
- name: Report Status
uses: ravsamhq/notify-slack-action@v1
if: always()
with:
status: ${{ job.status }}
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}