Skip to content

Commit

Permalink
fixing slack notification
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuchitra532 committed Feb 27, 2025
1 parent 2c8c2a0 commit 0016323
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/slack-notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Check Runner Status
id: check-runner
run: |
STATUS=$(gh api repos/YoYoGames/GM-TestFramework/actions/runners --jq '.runners[] | select(.status != "online") | .name')
STATUS=$(gh api repos/YoYoGames/GM-TestFramework/actions/runners --jq '.runners[] | select(.status != "online") | .name' | tr '\n' ', ' | sed 's/, $//')
if [[ -n "$STATUS" ]]; then
echo "Offline runners detected: $STATUS"
Expand All @@ -28,13 +28,13 @@ jobs:
fi
- name: Notify Slack (if runners restarted)
if: steps.check_runners.outputs.offline_runners != ''
if: ${{ env.RUNNER_OFFLINE == 'true' }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: gmtestframework-pipeline
SLACK_COLOR: ${{ job.status }}
SLACK_ICON: https://github.com/black.png?size=48
SLACK_MESSAGE: 'Runners are offline......'
SLACK_MESSAGE: "🚨 *Runner Offline Alert!* 🚨\nThe following runners are offline:$OFFLINE_RUNNERS Repository: GM-TestFramewor"
SLACK_TITLE: Notification for Runers
SLACK_USERNAME: ${{ github.actor }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
Expand Down

0 comments on commit 0016323

Please sign in to comment.