Skip to content

Commit e86341c

Browse files
committed
Notify rollbar on deploy failure
1 parent ed45803 commit e86341c

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

.github/workflows/codedeploy_production.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,3 +386,18 @@ jobs:
386386
else
387387
echo "⚠️ ROLLBAR_ACCESS_TOKEN not configured, skipping deployment notification"
388388
fi
389+
390+
- name: Notify Rollbar of deployment failure
391+
if: failure()
392+
run: |
393+
# Notify Rollbar of failed deployment (if token is configured)
394+
if [ -n "${{ secrets.ROLLBAR_ACCESS_TOKEN }}" ]; then
395+
curl -X POST 'https://api.rollbar.com/api/1/deploy/' \
396+
-F access_token="${{ secrets.ROLLBAR_ACCESS_TOKEN }}" \
397+
-F environment="production" \
398+
-F revision="${{ github.sha }}" \
399+
-F local_username="${{ github.actor }}" \
400+
-F comment="FAILED: CodeDeploy deployment from ${{ github.ref_name }}" \
401+
-F status=failed
402+
echo "📊 Rollbar failure notification sent"
403+
fi

.github/workflows/codedeploy_staging.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,3 +386,18 @@ jobs:
386386
else
387387
echo "⚠️ ROLLBAR_ACCESS_TOKEN not configured, skipping deployment notification"
388388
fi
389+
390+
- name: Notify Rollbar of deployment failure
391+
if: failure()
392+
run: |
393+
# Notify Rollbar of failed deployment (if token is configured)
394+
if [ -n "${{ secrets.ROLLBAR_ACCESS_TOKEN }}" ]; then
395+
curl -X POST 'https://api.rollbar.com/api/1/deploy/' \
396+
-F access_token="${{ secrets.ROLLBAR_ACCESS_TOKEN }}" \
397+
-F environment="staging" \
398+
-F revision="${{ github.sha }}" \
399+
-F local_username="${{ github.actor }}" \
400+
-F comment="FAILED: CodeDeploy deployment from ${{ github.ref_name }}" \
401+
-F status=failed
402+
echo "📊 Rollbar failure notification sent"
403+
fi

0 commit comments

Comments
 (0)