workflows: report a withheld review payload instead of crashing - #27
Merged
Conversation
GitHub withholds a job output whose value matches a registered secret. When that happened to the review output, the publish step ran JSON.parse(process.env.REVIEW) on an empty string and died with "SyntaxError: Unexpected end of JSON input", and the job surfaced the generic "GitHub could not publish the generated pull-request review". The completed review was lost and the real cause was invisible. Guard both payloads and fail with a reason that names the withheld output, so the log points at the secret match rather than at a JSON parse error. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
❌ OpenAI PR Review: FAIL
Conclusion: Not ready. 1 readiness blocker must be resolved before merge.
Review checks
| Check | Result |
|---|---|
| PR format | ❌ FAIL |
| Issue design | ✅ PASS |
| Code & plan conformance | ✅ PASS |
Scope: a612f21eff · 7954cfd6b5..a612f21eff · full · 1 diff chunk
Usage: 23s · 83,047 tokens · 70.6% cache hit · 2.464 credits
Blockers
pr-linkagePull request must natively close at least one same-repository Issue.
Summary
No actionable code findings or plan-conformance blockers remain after aggregating the completed chunk review.
Review metadata
- Commit:
a612f21eff - Range:
7954cfd6b5..a612f21eff - Mode:
full - Diff chunks:
1 - Model:
gpt-5.6-terra - Reasoning effort:
medium - Session:
repo-1309321116-pr-27-v2 - Generation:
325e7cfb3d52acb1d7fa46b6793e8f57f6da6ac2e827efb6f1f27a3b81a180a4 - Evidence:
4f277b9c6b7686149fbbf009624022aa0b4f80b01cf62687580579fdb4f7e2a3
Totals
- Input:
81,427 - Cached input:
57,469 - Cache write:
23,937 - Output:
1,620 - Reasoning:
446 - Total:
83,047 - Estimated credits:
2.464 - Credit rate per 1M tokens:
62.5input /6.25cached /375output
Token and cache details
| Stage | Mode | Target | Time | Input | Cached | Hit | Output | Total | Credits |
|---|---|---|---|---|---|---|---|---|---|
pr |
deterministic |
format rules |
0s | 0 | 0 | 0.0% | 0 | 0 | 0.000 |
pr |
full |
pr |
6s | 19,555 | 9,280 | 47.5% | 281 | 19,836 | 0.806 |
code |
full |
chunk 1/1 |
12s | 35,069 | 22,518 | 64.2% | 1,096 | 36,165 | 1.336 |
code |
full |
aggregate |
5s | 26,803 | 25,671 | 95.8% | 243 | 27,046 | 0.322 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #28
Problem
codex-openai-review.ymllost a completed review on GizClaw/gizclaw#1068 and reported a misleading reason.The
reviewjob finished and produced a full review payload. GitHub then refused to set the job output:A job output is withheld when its value matches a registered repository or organization secret.
needs.review.outputs.reviewwas therefore empty, and thepublishstep's first statements ran:JSON.parse('')threwSyntaxError: Unexpected end of JSON input, the step failed, and the job'sfailure_reasonfell through to the genericGitHub could not publish the generated pull-request review.The review, its findings and the credits spent producing it were all lost, and nothing in the reported reason pointed at the real cause.Neighbouring parses in the same script already guard their input (
JSON.parse(process.env.USAGE_JSON || '{}')); these two did not.Change
Both payloads go through one
requirePayloadhelper that fails with an explicit reason naming the withheld output and pointing at theSkip outputwarning, and reports a malformed payload separately from a missing one. No behaviour changes when the payload is present.Not addressed here
The underlying trigger is that a registered secret's value occurs inside ordinary review prose, which suggests the secret is stored with stray whitespace or is otherwise short enough to collide with English text. The review payload is model-generated prose about a diff and never contains the API key, so this is a false positive rather than a leak. Re-saving the secret as a single-line exact value stops the masking; encoding the payload to slip past the masker would defeat a protection that exists for good reason, so it is deliberately not done here.
Validation
actionlint .github/workflows/codex-openai-review.ymlreports only the pre-existingjob.workflow_repository/job.workflow_shawarnings, none at the changed lines.node --check.🤖 Generated with Claude Code