Skip to content
devopsfactory-ioPublic

About

Terraform and OpenTofu Pull Request Automation with Github Actions

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Latest commit

 

History

125 Commits

Folders and files

Neptune 🌊

Latest Release Go Docs Go Report Card CI Status

Neptune Logo

Terraform and OpenTofu pull request automation that runs inside GitHub Actions.

When apply runs after merge, errors land on main. Neptune runs plan and apply on the pull request. Real screens from neptune-tests PR #311: the changed stacks, Neptune's per-stack plan comment, its apply comment, and successful neptune plan and neptune apply statuses.

Set up Neptune in your repository →

Start with a test repository. You'll need GitHub Actions, the neptbot GitHub App, Terraform or OpenTofu stacks with remote state, and an S3-compatible or GCS bucket for Neptune's stack locks. The guide walks through app installation, credentials, configuration, and the workflow. Already using Terramate? Use the Terramate setup guide.

The GIF uses real screens from the public CI test neptune-tests #311. In that test, CI dispatched apply without a human approval review, and the PR was closed without merging.

Resources

What is Neptune?

A Terraform and OpenTofu pull request automation tool inspired by Atlantis. Its plan and apply commands run in GitHub Actions. It supports two modes for stack management: Terramate (using the Terramate Go SDK for change detection and run order) or local (config or stack.hcl discovery with git-based change detection). Object storage (GCS or S3) holds stack locks to coordinate changes across PRs; GitHub provides PR requirements, comments, and commit statuses.

What does it do?

Runs Terraform or OpenTofu plan and apply on pull requests with GitHub Actions. Locks stacks in object storage, checks configured PR requirements (e.g. approved, mergeable, undiverged), posts results as PR comments, and sets GitHub commit statuses for neptune plan and neptune apply (so you can require neptune apply in branch protection to block merge until apply succeeds).

Why should you use it?

With the typical Terraform + GitHub Actions flow, apply often runs after merge. If apply fails, fixing it requires follow-up PRs. Apply-before-merge (plan on PR → approve → apply on the PR → merge only when apply succeeds) lets teams catch apply failures before merging. Neptune and Atlantis both support this. Neptune runs plan and apply in GitHub Actions; the neptbot GitHub App triggers those workflows, and object storage holds stack locks. You can use GitHub-hosted runners with network access to your backend and providers.

  • Make Terraform/OpenTofu changes visible to your whole team
  • Apply approved changes in a consistent way
  • Standardize workflows with configurable plan/apply steps

For a detailed comparison of the normal Terraform workflow, Neptune, and Atlantis, see Workflow comparison.

About

Terraform and OpenTofu Pull Request Automation with Github Actions

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages