From 9e851a8f7cf24e1df2bdf2603ba0decabd296e31 Mon Sep 17 00:00:00 2001 From: Robin Newhouse Date: Fri, 30 Jan 2026 13:36:52 -0800 Subject: [PATCH] Add commit hash to PR review comments (#8982) Include the HEAD commit hash at the top of PR review comments so readers know which commit was reviewed. Also log commit info in the GitHub Actions output for debugging. --- .github/workflows/claude-pr-review.yml | 14 +++++++++++++- .github/workflows/cline-pr-review.yml | 14 +++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/claude-pr-review.yml b/.github/workflows/claude-pr-review.yml index ac4783a1bc..46b0552cb5 100644 --- a/.github/workflows/claude-pr-review.yml +++ b/.github/workflows/claude-pr-review.yml @@ -44,6 +44,12 @@ jobs: with: fetch-depth: 0 + - name: Print HEAD commit + run: | + echo "HEAD is at: $(git rev-parse HEAD)" + echo "Short: $(git rev-parse --short HEAD)" + git log -1 --format="Commit: %H%nAuthor: %an <%ae>%nDate: %ad%nMessage: %s" + - name: Get PR number id: pr run: | @@ -229,7 +235,13 @@ jobs: After your investigation, post a single helpful comment that helps the author and gives maintainers context. - Start with a warm thank you for their contribution. Be conversational, not robotic. + Start by noting the commit hash you reviewed: + ```bash + git rev-parse --short HEAD + ``` + Include this at the top of your comment: "Reviewed at commit: " + + Then thank them for their contribution. Be conversational, not robotic. Include what's relevant: - In-depth explanation of what the PR does - Be comprehensive. A maintainer should be able to read this section and fully understand the author's intent, why they made the changes, how they implemented it, and what files/systems are affected. Don't just summarize - explain. diff --git a/.github/workflows/cline-pr-review.yml b/.github/workflows/cline-pr-review.yml index c17b0067b5..8519ade98f 100644 --- a/.github/workflows/cline-pr-review.yml +++ b/.github/workflows/cline-pr-review.yml @@ -48,6 +48,12 @@ jobs: with: fetch-depth: 0 + - name: Print HEAD commit + run: | + echo "HEAD is at: $(git rev-parse HEAD)" + echo "Short: $(git rev-parse --short HEAD)" + git log -1 --format="Commit: %H%nAuthor: %an <%ae>%nDate: %ad%nMessage: %s" + - name: Setup Node.js uses: actions/setup-node@v4 with: @@ -269,7 +275,13 @@ jobs: After your investigation, post a single helpful comment that helps the author and gives maintainers context. - Start with a warm thank you for their contribution. Be conversational, not robotic. + Start by noting the commit hash you reviewed: + ```bash + git rev-parse --short HEAD + ``` + Include this at the top of your comment: "Reviewed at commit: " + + Then thank them for their contribution. Be conversational, not robotic. Include what'\''s relevant: - In-depth explanation of what the PR does - Be comprehensive. A maintainer should be able to read this section and fully understand the author'\''s intent, why they made the changes, how they implemented it, and what files/systems are affected. Don'\''t just summarize - explain.