Make PR_BODY_FILE work in CI by scoping reads to RUNNER_TEMP - #3742
Merged
Conversation
reakaleek
approved these changes
Jul 29, 2026
Mpdreamz
force-pushed
the
feature/changelog-validate
branch
2 times, most recently
from
July 29, 2026 15:52
9c9aa97 to
a829834
Compare
evaluate-pr read PR_BODY_FILE through FileSystemFactory.RealRead, which is scoped to the working directory and app data. RUNNER_TEMP is under neither, so in GitHub Actions the path failed the scope check, emitted "points to a missing file", and the PR body was silently dropped -- the env-var-overflow workaround PR_BODY_FILE exists for never took effect. Adds FileSystemFactory.RealReadForCI, which extends the RealRead scope with RUNNER_TEMP when that variable is set, and uses it in evaluate-pr. Paths outside the scope still fail the existence check and warn, so containment stays with the scoped filesystem rather than a hand-rolled path comparison. Extracts the body-reading logic (size cap, buffer pooling) into ChangelogPrBodyReader so it can be tested without a command harness. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Mpdreamz
force-pushed
the
feature/changelog-validate
branch
from
July 29, 2026 15:53
a829834 to
be81e01
Compare
Mpdreamz
enabled auto-merge (squash)
July 29, 2026 16:03
cotti
approved these changes
Jul 29, 2026
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.
Why
evaluate-prreadPR_BODY_FILEthroughFileSystemFactory.RealRead, which is scoped to the working directory and app data.RUNNER_TEMPis under neither, so in GitHub Actions the path failed the scope check, emitted "points to a missing file", and the PR body was silently dropped.PR_BODY_FILEexists precisely becausePR_BODYcan hit GitHub's 65,536-char limit and blow the runner's env-var budget. Since the scoped read rejected every path it was ever given, that workaround never took effect — callers staging the body inRUNNER_TEMPgot an empty body and no error.What
Adds
FileSystemFactory.RealReadForCI, which extends the standardRealReadscope withRUNNER_TEMPwhen that variable is set, and uses it inevaluate-pr. It falls back toRealReadwhen the variable is absent, so local runs are unchanged.Containment stays with the scoped filesystem rather than a hand-rolled path comparison in the caller: a path outside the allowed roots still fails the existence check and surfaces a warning, so the previous behaviour for genuinely out-of-scope paths is preserved.
The remaining body-reading logic — the 256 KiB cap and pooled-buffer truncation path — moves into
ChangelogPrBodyReaderso it can be tested without standing up a command harness.