Skip to content

Commit cff6ec4

Browse files
authored
workflows: keep stage snapshots out of job outputs (#24)
Publish only the structured summary, findings, and readiness fields across jobs while preserving full stage evidence in the existing review artifact. Cover the public output boundary to prevent GitHub secret scanning from suppressing it. Generated with [Codex](https://github.com/openai)
1 parent 6984a5e commit cff6ec4

2 files changed

Lines changed: 22 additions & 1 deletion

File tree

.github/scripts/pr-review/run.mjs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,15 @@ try {
734734
outputTokens: totals.output_tokens,
735735
});
736736

737-
appendOutput("review", JSON.stringify(review));
737+
// Cross-job outputs are inspected by GitHub's secret scanner. Keep the
738+
// publication payload to the fields consumed by readiness and publication;
739+
// the complete stage evidence remains in aggregate-result.json and the
740+
// encrypted Actions artifact.
741+
appendOutput("review", JSON.stringify({
742+
summary: review.summary,
743+
findings: review.findings,
744+
readiness: review.readiness,
745+
}));
738746
appendOutput("session_id", sessionId);
739747
appendOutput("generation_key", generation.key);
740748
appendOutput("usage_available", "true");

.github/scripts/pr-review/test.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,19 @@ fs.writeFileSync(outputFile, JSON.stringify(
542542
assert.equal(completedLedger.generations.at(-1).status, "completed");
543543
assert.equal(completedLedger.generations.at(-1).aggregate.metrics.input_tokens, 100);
544544
const reviewOutputs = fs.readFileSync(reviewOutput, "utf8");
545+
const reviewOutputLine = reviewOutputs
546+
.split("\n")
547+
.find((line) => line.startsWith("review="));
548+
assert.ok(reviewOutputLine);
549+
const publicReview = JSON.parse(reviewOutputLine.slice("review=".length));
550+
assert.deepEqual(Object.keys(publicReview).sort(), [
551+
"findings",
552+
"readiness",
553+
"summary",
554+
]);
555+
assert.equal(publicReview.summary, "Fake code review complete.");
556+
assert.deepEqual(publicReview.findings, []);
557+
assert.equal(publicReview.readiness.verdict, "pass");
545558
assert.match(reviewOutputs, /^credits_available=true$/m);
546559
assert.match(reviewOutputs, /^estimated_credits=0\.044$/m);
547560
const usageOutput = reviewOutputs

0 commit comments

Comments
 (0)