Skip to content

Commit 4ce3b6d

Browse files
committed
Update CI
1 parent 274dd6e commit 4ce3b6d

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

.github/workflows/pr-validate.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,17 @@ jobs:
6060
TIMESTAMP=$(date -u +'%Y-%m-%d %H:%M:%S UTC')
6161
FINAL_BODY="${COMMENT_BODY//TIMESTAMP_PLACEHOLDER_/$TIMESTAMP}"
6262
63-
# Edit last comment or create new one if none exist
64-
gh pr comment ${{ github.event.pull_request.number }} --edit-last --create-if-none --body "$FINAL_BODY"
63+
# Find the last comment made by github-actions bot with our marker
64+
COMMENT_ID=$(gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
65+
--jq '.[] | select(.user.login == "github-actions[bot]" and (.body | contains("<!-- pr-validation-checklist -->"))) | .id' \
66+
| tail -1)
67+
68+
if [ -n "$COMMENT_ID" ]; then
69+
# Update existing bot comment
70+
gh api repos/${{ github.repository }}/issues/comments/$COMMENT_ID \
71+
-X PATCH \
72+
-f body="$FINAL_BODY"
73+
else
74+
# Create new comment if none exists
75+
gh pr comment ${{ github.event.pull_request.number }} --body "$FINAL_BODY"
76+
fi

0 commit comments

Comments
 (0)