op5dev/Terraform/OpenTofu via Pull Request

Plan and apply Terraform/OpenTofu via PR automation, using best practices for secure and scalable IaC workflows.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Activelast commit Jul 9, 2026
License
Apache 2.0

Pinned Snippet

workflow.ymlSHA-pinned
uses: op5dev/tf-via-pr@39ed2635c056ca408ed24cc5c2baf0ef4381a7a5 # v13.7.4

tags can be moved; commit SHAs can't. why a SHA?

namedescriptionrequireddefault
commandCommand to run between: `plan` or `apply`. Optionally `init` for checks and outputs only (e.g., `plan`).no""
comment-methodPR comment by: `update` existing comment or `recreate` and delete previous one (e.g., `update`).noupdate
comment-pos-1Markdown content to render at various positions in the PR comment (e.g., `Before command`).no<!-- comment-pos-1 -->
comment-pos-2Markdown content to render at various positions in the PR comment (e.g., `Before diff`).no<!-- comment-pos-2 -->
comment-pos-3Markdown content to render at various positions in the PR comment (e.g., `Before summary`).no<!-- comment-pos-3 -->
comment-pos-4Markdown content to render at various positions in the PR comment (e.g., `Before footer`).no<!-- comment-pos-4 -->
comment-pos-5Markdown content to render at various positions in the PR comment (e.g., `Before identifier`).no<!-- comment-pos-5 -->
comment-pos-6Markdown content to render at various positions in the PR comment (e.g., `After identifier`).no<!-- comment-pos-6 -->
comment-prAdd a PR comment: `always`, `on-diff`, or `never` (e.g., `always`).noalways
expand-diffExpand the collapsible diff section (e.g., `false`).nofalse
expand-summaryExpand the collapsible summary section (e.g., `false`).nofalse
formatCheck format of TF code (e.g., `false`).nofalse
hide-argsHide comma-separated arguments from the command input (e.g., `detailed-exitcode,lock,out,var=`).nodetailed-exitcode,parallelism,lock,out,var=
plan-encryptEncrypt plan file artifact with the given input (e.g., `secrets.PASSPHRASE`).no""
plan-fileSupply existing plan file path instead of the auto-generated one (e.g., `path/to/file.tfplan`).no""
plan-parityReplace the plan file if it matches a newly-generated one to prevent stale apply (e.g., `false`).nofalse
pr-numberSpecify PR number in case of unsupported workflow trigger (e.g., `123`).no""
preserve-planPreserve plan file in the given working directory after workflow execution (e.g., `false`).nofalse
retention-daysDuration after which plan file artifact will expire in days (e.g., '90').no""
show-argsShow comma-separated arguments in the command input (e.g., `workspace`).noworkspace
tag-actorTag the workflow triggering actor: `always`, `on-diff`, or `never` (e.g., `always`).noalways
tokenSpecify a GitHub token (e.g., `secrets.GITHUB_TOKEN`).no${{ github.token }}
toolProvisioning tool to use between: `terraform` or `tofu` (e.g., `terraform`).noterraform
upload-planUpload plan file as GitHub workflow artifact (e.g., `true`).notrue
validateCheck validation of TF code (e.g., `false`).nofalse
working-directorySpecify the working directory of TF code, alias of `arg-chdir` (e.g., `stacks/dev`).no""
arg-auto-approveauto-approveno""
arg-backend-configbackend-configno""
arg-backendbackendno""
arg-backupbackupno""
arg-chdirchdirno""
arg-checkchecknotrue
arg-compact-warningscompact-warningsno""
arg-conciseconciseno""
arg-destroydestroyno""
arg-detailed-exitcodedetailed-exitcodenotrue
arg-diffdiffnotrue
arg-force-copyforce-copyno""
arg-from-modulefrom-moduleno""
arg-generate-config-outgenerate-config-outno""
arg-getgetno""
arg-listlistno""
arg-lock-timeoutlock-timeoutno""
arg-locklockno""
arg-lockfilelockfileno""
arg-migrate-statemigrate-stateno""
arg-no-testsno-testsno""
arg-parallelismparallelismno""
arg-plugin-dirplugin-dirno""
arg-reconfigurereconfigureno""
arg-recursiverecursivenotrue
arg-refresh-onlyrefresh-onlyno""
arg-refreshrefreshno""
arg-replacereplaceno""
arg-state-outstate-outno""
arg-statestateno""
arg-targettargetno""
arg-test-directorytest-directoryno""
arg-upgradeupgradeno""
arg-var-filevar-fileno""
arg-varvarno""
arg-workspaceworkspaceno""
arg-writewriteno""
namedescription
check-idID of the check run.
commandInput of the last TF command.
comment-bodyBody of the PR comment.
comment-idID of the PR comment.
diffDiff of changes, if present (truncated).
exitcodeExit code of the last TF command.
identifierUnique name of the workflow run and artifact.
job-idID of the workflow job.
plan-idID of the plan file artifact.
plan-urlURL of the plan file artifact.
resultResult of the last TF command (truncated).
run-urlURL of the workflow run.
summarySummary of the last TF command.