Skip to content

Commit 24d544a

Browse files
committed
ci: check out base repo in clang-tidy-bazel-post so reviewdog finds .git
Reviewdog's github-pr-review reporter resolves the local git root before flushing comments. On a fresh runner containing only the downloaded artifact, reviewdog logs "reviewdog: .git not found" and silently no-ops (exit 0, no review posted). Confirmed locally by running reviewdog from a scratch dir against the same synthesized event + artifact: zero comments posted; running the same command from inside a checkout works. Add a shallow actions/checkout step before the artifact download. The default ref in workflow_run context is the base repo's default branch, which is safe (no fork code) and sufficient — reviewdog fetches the actual PR diff via the GitHub API, so the local SHA need not match. Signed-off-by: Joao Luis Sombrio <sombrio@sombrasoft.dev>
1 parent 2d79066 commit 24d544a

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/github-actions-clang-tidy-bazel-post.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ jobs:
2828
if: ${{ github.event.workflow_run.conclusion == 'success' }}
2929
runs-on: ${{ vars.USE_SELF_HOSTED == 'true' && 'self-hosted' || 'ubuntu-latest' }}
3030
steps:
31+
# Reviewdog's github-pr-review reporter resolves the local git root
32+
# before flushing comments and silently no-ops if .git is missing.
33+
# Check out the base repo (default branch, shallow) so reviewdog has
34+
# a .git directory to operate against. No fork code involved — this
35+
# is the base repo at HEAD of its default branch.
36+
- name: Check out base repo for reviewdog .git requirement
37+
uses: actions/checkout@v6
38+
with:
39+
fetch-depth: 1
40+
# Default ref in workflow_run context is the base repo's default
41+
# branch, which is the safe choice here. Reviewdog uses GitHub
42+
# API to fetch the actual PR diff, so the local SHA need not
43+
# match the PR head.
44+
3145
- name: Download clang-tidy artifact
3246
uses: actions/download-artifact@v4
3347
with:

0 commit comments

Comments
 (0)