File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments