refactor(opentofu): run pre-commit once per workflow - #39
Merged
Conversation
Shared Workflows CIShared workflows CI passed. View run output |
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.
Summary
Replace the preliminary selected-hook pass plus full validation pass with one full canonical pre-commit run. If that run changes tracked files on a trusted same-repository PR, later
always()-guarded steps mint the existing App token and commit the changes; the push starts the confirmation workflow run. The failed originating pre-commit step keeps the initial run from reachingplan.No linked issue.
Type of change
Validation
Representative consumer validation passed through temporary
tfroot-aws#35: the candidate workflow generated an App-authored autofix, cancelled the original test run before plan, then a replacement run passed full pre-commit and its credentialed plan. No local OpenTofu operation was run.Impact and rollout
Canonical producer:
makeitworkcloud/shared-workflows/.github/workflows/opentofu.yml. The active@maincallers intfroot-aws,tfroot-cloudflare,tfroot-gcp,tfroot-github,tfroot-libvirt, andtfroot-namecheappreserve their inputs, secrets, permissions, runner labels, and apply behavior; each already maps the App key. No caller change is needed.Clean workflow runs now invoke pre-commit once. Autofix runs deliberately fail their original test step, preventing its plan, then push the autofix to trigger a clean confirmation run and plan. Forks, missing-key PRs, and
mainpushes still fail on drift and never auto-commit. Merge is the remaining gate; no artifact publication, GitOps selection, reconciliation, or infrastructure apply is involved.Safety and secrets
AI-assisted change. Agent-knowledge topology revision consulted:
f3f7228652495d1082bfbdb6f06de7c6ebf1224b. Material caller and runtime relationships were re-verified against current source.