nakamasato/Terraform Auto Approver

Auto-approve Terraform pull requests when the terraform plan JSON matches declarative safety rules, using a GitHub App identity so the approval counts toward required reviews.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
github-tokenGitHub App installation token with `pull-requests: write`. Generate it in your workflow with actions/create-github-app-token and pass its output here. Do NOT use the default GITHUB_TOKEN: github-actions[bot] cannot approve PRs.yes
plan-filesGlob pattern(s) or newline-separated paths to the terraform plan JSON file(s) to evaluate (produced by `terraform show -json <planfile>`). Every matched plan must satisfy at least one rule for the PR to be approved.yes
configPath to the rules config YAML.no.github/tf-pr-approver.yml
allow-empty-plansTreat "no plan file matched" as OK instead of failing the job. Enable it when a PR that is in scope can legitimately produce no plan JSON (e.g. a docs-only change in a monorepo). Requires `target_paths` in the config: without a scope check an empty plan set would approve any PR.nofalse
pull-request-numberPull request number to approve. Defaults to the PR from the event context.no""
approve-messageBody text used for the approval review.noAuto-approved by tf-pr-approver: the terraform plan matched the configured safe-change rules.
namedescription
approved"true" if the PR was approved (or already approved), "false" otherwise.
matched-rulesJSON object mapping each evaluated plan file to the rule name it matched (or null).
out-of-scope-filesJSON array of changed files outside `target_paths` (empty when the scope check passed).