Skip to content

Commit

Permalink
Debug map_new_plugins.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
KartikP authored Oct 31, 2024
1 parent 889b617 commit 3ddd8c0
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/map_new_plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,26 @@ jobs:
completed_checks=0
echo "Using github PR head sha: ${{ github.event.pull_request.head.sha }}"
echo "Option to use github sha: ${{ github.sha }}"
# Fetch the status of all checks for this commit
statuses=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/brain-score/vision/commits/${{ github.event.pull_request.head.sha }}/status" | jq -r '.statuses[] | {context: .context, state: .state}')
echo "Statuses response from GitHub API:"
echo "$statuses" | jq '.'
# Check if both required jobs are marked as 'success'
# Parse the statuses and check each required job for success
for check in "${required_checks[@]}"; do
if echo "$statuses" | grep -q "$check.*success"; then
if echo "$statuses" | jq -e --arg check "$check" '.statuses[] | select(.context == $check) | select(.state == "success")' > /dev/null; then
echo "Job '$check' is successful."
((completed_checks+=1))
else
echo "Job '$check' is NOT successful."
fi
done
echo "Completed checks: $completed_checks / ${#required_checks[@]}"
# Fail this step if not all required jobs are completed
if [ "$completed_checks" -ne "${#required_checks[@]}" ]; then
echo "Not all required Jenkins jobs are complete. Exiting."
Expand Down

0 comments on commit 3ddd8c0

Please sign in to comment.