Skip to content

Commit

Permalink
Update check-pr.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kdivya153 authored Oct 13, 2024
1 parent 2393f27 commit 2ab644d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,3 +80,27 @@ jobs:
sleep 120
fi
done
notify-slack-on-failure:
needs: wait-for-repo2
if: failure()
runs-on: ubuntu-latest
steps:
- name: Send Slack notification
run: |
# Determine the branch name based on the event type
if [ "$EVENT_NAME" == "repository_dispatch" ]; then
BRANCH_NAME=$OPENRPC_PR_BRANCH
elif [ "$EVENT_NAME" == "pull_request" ]; then
BRANCH_NAME=$PR_HEAD_REF
elif [ "$EVENT_NAME" == "push" ]; then
BRANCH_NAME=${GITHUB_REF#refs/heads/} # Extract branch name from GITHUB_REF for push events
else
BRANCH_NAME="unknown"
fi
# Send the Slack notification with the branch name
curl -X POST -H 'Content-type: application/json' \
--data '{"text": "Failed to generate SDK artifact with the latest changes in the Branch: '$BRANCH_NAME'."}' \
${{ secrets.SLACK_WEBHOOK_URL }}

0 comments on commit 2ab644d

Please sign in to comment.