diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c7cf9d..25bd031 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: repo: context.repo.repo, issue_number: issue_number, }); - const approvalComment = comments.data.find(comment => comment.body.includes('Please approve this PR by reacting with an "ok" emoji to this comment.') && comment.user.login === 'github-actions[bot]'); + const approvalComment = comments.data.find(comment => comment.body.includes('Please approve this PR by reacting with an "👍".') && comment.user.login === 'github-actions[bot]'); if (approvalComment) { core.setOutput('commentExists', 'true'); core.setOutput('commentId', approvalComment.id); @@ -75,7 +75,7 @@ jobs: owner: context.repo.owner, repo: context.repo.repo, issue_number: issue_number, - body: 'Please approve this PR by reacting with an "ok" emoji to this comment.' + body: 'Please approve this PR by reacting with an "👍".' }); core.setOutput('result', comment.data.id); return comment.data.id; @@ -83,10 +83,14 @@ jobs: - name: Wait for Approval run: | comment_id=${{ steps.check-comment.outputs.result || steps.create-comment.outputs.result }} + echo "Comment ID: $comment_id" counter=0 while [ $counter -lt 15 ]; do + echo "Checking for approvals, attempt $((counter + 1))" response=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.squirrel-girl-preview+json" "https://api.github.com/repos/${{ github.repository }}/issues/comments/$comment_id/reactions") - approved=$(echo "$response" | jq '.[] | select(.content == "ok") | .user.login' | grep -wFf <(echo $TEAM_MEMBERS)) + echo "Response: $response" + approved=$(echo "$response" | jq '.[] | select(.content == "+1") | .user.login') + echo "Approved: $approved" if [ -n "$approved" ]; then echo "PR has been approved by a team member." break @@ -94,6 +98,7 @@ jobs: sleep 60 ((counter++)) done + if [ $counter -ge 15 ]; then echo "Timeout reached for Approval - 15m. Exiting..." exit 1