Commit 51ace53
committed
ci: overwrite runner event file so reviewdog detects fork PRs
clang-tidy-bazel-post posted no review comments on fork PRs: reviewdog
exited with "this is not PullRequest build" on every run (PRs #10550,
#10553, #10226, #10565).
Root cause, confirmed via a debug-gated env dump (public run 26681282929
attempt 2 on PR #10565): GITHUB_EVENT_PATH and GITHUB_EVENT_NAME are
runner-protected default env vars. The step-level `env:` override we used
to point reviewdog at a synthesized pull_request payload is silently
dropped -- the runner re-injects the real workflow_run event file, whose
payload carries no usable pull_request (its pull_requests[] is empty for
fork PRs). reviewdog's cienv parses that file, sees PullRequest == 0, and
bails before posting. The synthesized side file was correct but never read.
Fix: stop trying to override the env pointer (a no-op) and instead
overwrite the runner's event file in place with the synthesized
pull_request payload. reviewdog's cienv only parses the file at
GITHUB_EVENT_PATH (it does not check GITHUB_EVENT_NAME), so the overwrite
alone makes detection succeed. Owner/repo/head-sha all come from the
payload we write, so the now-dead GITHUB_* overrides on the reviewdog step
are removed. Nothing after the synth step depends on the original
workflow_run event, so overwriting it is safe.
The debug-gated diagnostic step (runner.debug == '1') is kept and updated
to verify the event file now holds the synthesized payload.
Signed-off-by: Joao Luis Sombrio <sombrio@sombrasoft.dev>1 parent af39e7f commit 51ace53
1 file changed
Lines changed: 13 additions & 36 deletions
Lines changed: 13 additions & 36 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
88 | 87 | | |
89 | 88 | | |
90 | 89 | | |
91 | 90 | | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
125 | 124 | | |
126 | 125 | | |
127 | 126 | | |
128 | 127 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 128 | + | |
| 129 | + | |
137 | 130 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | 131 | | |
144 | | - | |
| 132 | + | |
145 | 133 | | |
146 | 134 | | |
147 | | - | |
148 | | - | |
149 | | - | |
| 135 | + | |
| 136 | + | |
150 | 137 | | |
151 | | - | |
152 | 138 | | |
153 | 139 | | |
154 | 140 | | |
155 | 141 | | |
156 | 142 | | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | 143 | | |
162 | 144 | | |
163 | 145 | | |
164 | 146 | | |
165 | | - | |
166 | | - | |
167 | | - | |
168 | | - | |
169 | 147 | | |
170 | | - | |
171 | | - | |
| 148 | + | |
172 | 149 | | |
173 | 150 | | |
174 | 151 | | |
| |||
0 commit comments