Skip to content

Commit

Permalink
ci: make sure to get first comment
Browse files Browse the repository at this point in the history
  • Loading branch information
sdobbert committed Jun 26, 2024
1 parent a4380ff commit df5b76b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/on-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ jobs:
run: |
COMMENT="⚠️ No tests were found related to the files changed since the last commit."
PR_NUMBER=${{ github.event.pull_request.number }}
COVERAGE_COMMENT_ID=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" | \
jq -r '.[] | select(.user.login == "github-actions[bot]") | .id')
COMMENTS_JSON=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments")
COVERAGE_COMMENT_ID=$(echo "${COMMENTS_JSON}" | jq -r 'map(select(.user.login == "github-actions[bot]")) | sort_by(.created_at) | .[0].id')
echo "COVERAGE_COMMENT_ID: ${COVERAGE_COMMENT_ID}"
if [ -z "$COVERAGE_COMMENT_ID" ]; then
Expand Down

0 comments on commit df5b76b

Please sign in to comment.