Workflow comparison: Terraform plan/apply with GitHub Actions and Atlantis¶
This page compares three ways to run Terraform or OpenTofu plan and apply in a pull-request workflow. The main idea: apply-before-merge keeps your default branch (main) fully executable, because apply runs on the PR and you only merge when it succeeds. In a "normal" workflow where apply runs after merge, code on main is not guaranteed to be executable—errors surface after merge and require follow-up PRs.
Normal Terraform + GitHub Actions workflow¶
Apply runs after merge (e.g. on push to main or a post-merge job). Code on main is not guaranteed to be fully executable.
- Dev changes
.tf→ opens PR - Plan executed (on PR)
- PR approved → merge
- Apply executed (on
main) - Error → open another PR to fix
- Plan executed → PR approved → merge → Apply executed
- Error again → repeat…
Each failure lands broken code on main and forces a new PR cycle.
Neptune workflow¶
Apply runs on the PR when you trigger it (e.g. comment @neptbot apply). You merge only after apply succeeds. All code on main stays fully executable. Everything runs inside GitHub Actions—no separate servers.
- Dev changes
.tf→ opens PR - Plan executed (GitHub Actions)
- PR approved → comment
@neptbot apply - Apply executed (GitHub Actions)
- Error → push changes to the same PR
@neptbot applyagain → Apply executed- Merge when apply succeeds (all within GitHub Actions)
Atlantis workflow¶
Same apply-before-merge idea as Neptune: plan on PR, apply on PR (e.g. comment atlantis apply), merge when apply succeeds. Difference: execution runs on a separate (self-hosted) server, not in GitHub Actions.
- Dev changes
.tf→ opens PR - Plan executed (Atlantis server)
- PR approved → comment
atlantis apply - Apply executed (Atlantis server)
- Error → push changes to the same PR
atlantis applyagain → Apply executed- Merge when apply succeeds (execution stays on the Atlantis server)
Comparison at a glance¶
| Normal Terraform + GHA | Neptune | Atlantis | |
|---|---|---|---|
| Apply before merge? | No (apply after merge) | Yes | Yes |
| Main branch executable? | No | Yes | Yes |
| Where plan/apply run? | GitHub Actions | GitHub Actions | Self-hosted server |
| Extra infrastructure? | No | No | Yes (Atlantis server) |
When to choose Neptune: You want apply-before-merge and to keep everything in GitHub Actions—no extra servers or self-hosted runners to operate.
When Atlantis may fit: You already run Atlantis or prefer a dedicated self-hosted service for Terraform runs; the workflow is similar, but execution is outside GitHub.