Description
tf-via-pr is a GitHub Action that plans and applies Terraform or OpenTofu changes through pull request automation. A pull request runs a plan, and the outline of the proposed changes is written into a PR comment that stays up to date, together with a matrix-friendly workflow summary and the full log. Applies run from the arguments you pass in, and an encrypted plan file is used to avoid configuration drift. The usage examples cover a plan on pull requests with an apply on push, an OpenTofu matrix, formatting and TFLint checks, conditional jobs based on the plan file, a self-hosted runner for GitHub Enterprise, and a scheduled refresh-only run that opens an issue when drift is found. Cloud credentials can be passed as environment variables, including short-lived OIDC credentials for AWS. The project is aimed at DevOps and platform engineers who want teams to make infrastructure changes on their own, and at maintainers who want a secure pipeline without running containers or virtual machines.…
Highlights
- Plans on pull requests and applies on push or merge
- Diff outline posted as an up-to-date PR comment
- Encrypted plan file to avoid configuration drift
- Works with Terraform and OpenTofu
- Scheduled drift detection with refresh-only runs
Ratings & Reviews
No ratings yet
Be the first to rate TF-via-PR.
People also visit
TF-via-PR FAQ
What does it do?
It runs Terraform or OpenTofu plans and applies from pull request automation, and posts a summary of the changes back to the pull request.
Who is it for?
DevOps and platform engineers who want teams to self-serve infrastructure changes, and maintainers who want a secure pipeline without containers or VMs.
Can it authenticate to AWS?
Yes. The docs show passing short-lived credentials from OIDC, for example through the configure-aws-credentials action, as environment variables.
Does it run on GitHub Enterprise?
Yes. One example runs on a self-hosted runner for GitHub Enterprise, triggered by a label or a manual workflow dispatch.
Any setup tips?
The project recommends setting the terraform_wrapper or tofu_wrapper input to false so the detailed exit code is returned for better error handling.
What are the best TF-via-PR alternatives?
Popular alternatives to TF-via-PR include Atlantis, Opensible and Create Pull Request. See all TF-via-PR alternatives









