Skip to content

Commit

Permalink
Merge pull request #8 from cds-snc/feat/notify_slack_if_s3_backup_fails
Browse files Browse the repository at this point in the history
Notify slack channel when the S3 backup fails
  • Loading branch information
sylviamclaughlin committed Jun 13, 2023
2 parents d11e574 + 9d15efe commit 21a7c5b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/s3-backup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,10 @@ jobs:
- name: Upload to S3 bucket
run: |
aws s3 sync . s3://${{ secrets.AWS_S3_BACKUP_BUCKET }} --exclude='*' --include='${{ github.repository }}/*'
aws s3 sync . s3://${{ secrets.AWS_S3_BACKUP_BUCKET }} --exclude='*' --include='${{ github.repository }}/*'
- name: Notify Slack channel if this job failed
if: ${{ failure() }}
run: |
json='{"text":"S3 backup failed in <https://github.com/${{ github.repository }}>!"}'
curl -X POST -H 'Content-type: application/json' --data "$json" ${{ secrets.SLACK_NOTIFY_WEBHOOK }}

0 comments on commit 21a7c5b

Please sign in to comment.