Skip to content

Commit b1ecfaf

Browse files
authored
Merge pull request #2656 from port-labs/claude-fix
fix logic
2 parents 6fe6235 + ac5743b commit b1ecfaf

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

.github/workflows/claude-pr-reviewer.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,22 @@ jobs:
4949
git config --global user.name "Port Claude AI"
5050
git config --global user.email "port-claude-ai@port.io"
5151
52-
- name: Find Last Claude Comment
53-
uses: peter-evans/find-comment@v3
54-
id: find-comment
55-
with:
56-
issue-number: ${{ github.event.pull_request.number }}
57-
comment-author: 'claude'
58-
direction: last
59-
60-
- name: Delete Last Claude Comment
61-
if: steps.find-comment.outputs.comment-id != ''
52+
- name: Find and Delete Last Claude Comment
6253
env:
6354
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6455
run: |
65-
gh api repos/${{ github.repository }}/issues/comments/${{ steps.find-comment.outputs.comment-id }} -X DELETE
66-
echo "Deleted last Claude comment ID: ${{ steps.find-comment.outputs.comment-id }}"
56+
echo "Looking for the last Claude comment to delete..."
57+
58+
# Get the last Claude comment ID (trying common patterns)
59+
last_claude_comment=$(gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
60+
--jq '.[] | select(.user.login | test("claude"; "i")) | .id' | tail -1)
61+
62+
if [ ! -z "$last_claude_comment" ]; then
63+
echo "Deleting last Claude comment ID: $last_claude_comment"
64+
gh api repos/${{ github.repository }}/issues/comments/$last_claude_comment -X DELETE
65+
else
66+
echo "No Claude comments found to delete"
67+
fi
6768
6869
- name: Run Claude PR Action
6970
uses: anthropics/claude-code-action@beta

0 commit comments

Comments
 (0)