Skip to content

fix: isolate OpenTofu plan comment capture - #35

Merged
xnoto merged 1 commit into
mainfrom
fix/opentofu-plan-comment-capture
Aug 30, 2026
Merged

fix: isolate OpenTofu plan comment capture#35
xnoto merged 1 commit into
mainfrom
fix/opentofu-plan-comment-capture

Conversation

@xnoto

@xnoto xnoto commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix corrupted OpenTofu plan PR comments by giving the reusable workflow its own capture file. Consumer Makefiles continue to write plan-output.txt; the workflow now writes and reads plan-capture.txt, preventing concurrent truncating writers from producing sparse-file NUL holes.

The primary comment extraction now ends at the first Plan: summary, excluding the duplicate human-readable rendering emitted by tofu show. A tr -d '\000' stage removes malformed embedded NUL bytes before the existing ANSI stripping and sensitive-output redaction pipeline.

Validation

  • Inspected the committed GitHub diff: only .github/workflows/opentofu.yml changed (7 additions, 6 deletions).
  • Verified tfroot-github, tfroot-aws, tfroot-libvirt, and tfroot-cloudflare Makefiles each write plan-output.txt from tofu show.
  • No local validation is available on this headless server; CI is the validation authority.

No consumer workflow references, markers, comment lifecycle, inputs, permissions, output cap, action pins, or redaction rules were changed.

@xnoto
xnoto requested a review from a team as a code owner August 30, 2026 18:53
@github-actions

Copy link
Copy Markdown

Shared workflows CI passed

View the workflow run.

Validation output (redacted, last 12000 characters)

[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/gitleaks/gitleaks.
[INFO] Initializing environment for https://github.com/rhysd/actionlint.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/gitleaks/gitleaks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/rhysd/actionlint.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
check for case conflicts.................................................Passed
check for merge conflicts................................................Passed
check for broken symlinks............................(no files to check)Skipped
check vcs permalinks.....................................................Passed
detect destroyed symlinks................................................Passed
detect private key.......................................................Passed
mixed line ending........................................................Passed
trim trailing whitespace.................................................Passed
Detect hardcoded secrets.................................................Passed
Lint GitHub Actions workflow files.......................................Passed

@xnoto
xnoto merged commit 6330a97 into main Aug 30, 2026
2 checks passed
@xnoto
xnoto deleted the fix/opentofu-plan-comment-capture branch August 30, 2026 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant