scarowar/terraform-branch-deploy

Terraform integrated into the Branch Deploy operating model. Plan, review, and apply infrastructure changes within Pull Requests to ensure the main branch remains stable.

View on GitHub

Trust Signals

Scorecard Score
not yet scored
Maintenance Recency
Stale
License
None
namedescriptionrequireddefault
modetrigger = Parse command via branch-deploy, export TF_BD_* to GITHUB_ENV, STOP execute = Run terraform with lifecycle completion (reads TF_BD_* from GITHUB_ENV) Use both modes as CONDITIONAL STEPS in a SINGLE JOB: - Trigger mode exports env vars - Custom steps (credentials) can access env vars - Execute mode picks up env vars automatically yes
github-tokenGitHub token with Branch Deploy permissions: pull-requests:write, deployments:write, contents:write, checks:read, statuses:read, actions:readyes
config-pathPath to .tf-branch-deploy.yml.tf-branch-deploy.yml
terraform-versionTerraform version to installlatest
dry-runPrint commands without runningfalse
plan-retention-daysDays to keep saved plan artifacts before they expire (1-90, capped by the repository's artifact retention setting)7
triggerDeploy command trigger.apply
noop-triggerPlan command trigger.plan
lock-triggerLock command trigger.lock
unlock-triggerUnlock command trigger.unlock
help-triggerHelp command trigger.help
lock-info-aliasLock info alias.wcid
param-separatorParameter separator in commands|
environment-targetsComma-separated environments (auto-detected from config if empty)""
production-environmentsComma-separated production environments""
environment-urlsEnvironment URLs mapping""
draft-permitted-targetsEnvironments allowing draft PR deployments""
stable-branchStable branch for rollbacksmain
update-branchHow to handle outdated branches: disabled|warn|forcewarn
outdated-modeHow to handle outdated branchesstrict
allow-sha-deploymentsAllow deployments by SHAfalse
enforced-deployment-orderRequired deployment order""
checksWhich checks must pass before deploymentall
ignored-checksChecks to ignore""
skip-ciCI pattern to skip""
skip-reviewsSkip PR review requirement""
required-contextsRequired status contexts""
permissionsRequired permissionswrite,admin
adminsAdmin users/teamsfalse
admins-patAdmin PAT for checksfalse
commit-verificationRequire verified commitsfalse
disable-naked-commandsRequire 'to <env>' in commandsfalse
allow-non-default-target-branchAllow non-default target branchesfalse
deployment-confirmationRequire deployment confirmationfalse
deployment-confirmation-timeoutConfirmation timeout seconds300
global-lock-flagGlobal lock flag--global
sticky-locksKeep locks after deploymentfalse
sticky-locks-for-noopKeep locks for noopfalse
use-security-warningsShow security warningstrue
reactionInitial reaction to commandeyes
namedescription
continue'true' if deployment should proceed
triggered'true' if command was detected
environmentTarget environment
operationplan, apply, or rollback
is-rollback'true' if rollback operation
shaCommit SHA to deploy
refBranch ref to checkout (stable branch for rollbacks)
noop'true' for plan operations
actorUser who triggered deployment
paramsRaw parameters from command
comment-idTriggering comment ID
deployment-idGitHub deployment ID
initial-reaction-idInitial reaction ID for cleanup
typeCommand type (deploy, lock, unlock, etc.)
issue-numberPR/Issue number
working-directoryTerraform working directory
var-filesJSON array of var files
is-production'true' if production environment
plan-filePath to plan file (after plan)
plan-checksumSHA256 of plan file
has-changes'true' if plan has changes