@@ -16,20 +16,30 @@ jobs:
1616 echo "Fetching GitHub-Slack user mappings..."
1717 MAPPINGS=$(curl -s https://raw.githubusercontent.com/hmcts/github-slack-user-mappings/master/slack.json)
1818
19- echo "Mappings fetched:"
20- echo "$MAPPINGS" | jq '.'
19+ echo "=== Full mappings JSON ==="
20+ echo "$MAPPINGS"
21+ echo "========================="
2122
2223 GITHUB_REVIEWERS=$(echo '${{ toJson(github.event.pull_request.requested_reviewers) }}' | jq -r '.[].login')
2324
25+ echo "GitHub reviewers to lookup: $GITHUB_REVIEWERS"
26+
2427 SLACK_IDS=""
2528 for github_user in $GITHUB_REVIEWERS; do
29+ echo "Looking up: $github_user"
30+
31+ echo "$MAPPINGS" | jq --arg user "$github_user" '.[] | select(.github == $user)'
32+
2633 slack_id=$(echo "$MAPPINGS" | jq -r --arg user "$github_user" '.[] | select(.github == $user) | .slack')
34+
35+ echo "Found slack_id: '$slack_id'"
36+
2737 if [ -n "$slack_id" ]; then
2838 SLACK_IDS="$SLACK_IDS<@$slack_id> "
29- echo "Mapped $github_user -> $slack_id"
39+ echo "✓ Mapped $github_user -> $slack_id"
3040 else
3141 SLACK_IDS="$SLACK_IDS@$github_user "
32- echo "No mapping found for $github_user, using GitHub username "
42+ echo "✗ No mapping found for $github_user"
3343 fi
3444 done
3545
3949 PR_URL="${{ github.event.pull_request.html_url }}"
4050 PR_AUTHOR="${{ github.event.pull_request.user.login }}"
4151
42- MESSAGE="New PR review requested: '$PR_TITLE' by @$PR_AUTHOR\nReviewers: $SLACK_IDS${TEAM_REVIEWERS:+Team: $TEAM_REVIEWERS}\n$PR_URL"
43-
44- echo "Final message:"
45- echo "$MESSAGE"
52+ MESSAGE="New PR review requested: '$PR_TITLE' by @$PR_AUTHOR - Reviewers: $SLACK_IDS${TEAM_REVIEWERS:+Team: $TEAM_REVIEWERS} - $PR_URL"
4653
4754 PAYLOAD=$(jq -n --arg text "$MESSAGE" '{"text": $text}')
4855
0 commit comments