Skip to content

Pull requests and triggers

Terrateam seamlessly integrates with GitHub’s pull request workflow, allowing you to trigger Terraform operations directly from your pull requests. This section will guide you through the different ways Terrateam can be triggered and how to use pull requests effectively with Terrateam.

Triggering Terrateam

Terrateam supports several methods to trigger Terraform operations:

  • Opening a pull request: When you open a new pull request containing changes to your Terraform code, Terrateam automatically detects the changes and triggers a plan operation. This allows you to review the proposed changes before merging them into your main branch.
  • Updating a pull request: If you push additional commits to a pull request, Terrateam will re-run the plan operation to ensure that the proposed changes are up to date.
  • Commenting on a pull request: You can manually trigger Terrateam operations by adding comments to your pull request. Terrateam supports the following commands:
    • terrateam plan: Triggers a plan operation on the pull request.
    • terrateam apply: Triggers an apply operation, applying the changes proposed in the pull request.

Pull request workflow

Here’s a typical workflow when using Terrateam with pull requests:

  1. Create a branch

    Create a new branch in your repository to work on your Terraform changes. This branch will be used to create a pull request later.

  2. Make changes

    Make the necessary changes to your Terraform code in the newly created branch. Commit and push your changes to the remote repository.

  3. Open a pull request

    Open a new pull request from your branch to the main branch (e.g., main or master). Terrateam will automatically detect the pull request and trigger a plan operation.

  4. Review the plan

    Terrateam will add a comment to your pull request with the output of the plan operation. Review the proposed changes and ensure they align with your expectations.

  5. Collaborate and iterate

    If necessary, collaborate with your team by requesting reviews, discussing changes, and making additional commits to the pull request. Terrateam will re-run the plan operation each time you update the pull request.

  6. Apply the changes

    Once you’re satisfied with the proposed changes, you can trigger an apply operation by commenting terrateam apply on the pull request. Terrateam will attemp to acquire a lock, apply the changes, and update the pull request with the result.

  7. Merge the pull request

    After a successful apply, merge the pull request into your main branch to incorporate the changes into your production environment. Terrateam will then release the acquired lock.

We use cookies and similar technologies to provide certain features, enhance the user experience and deliver content that is relevant to your interests. Depending on their purpose, analysis and marketing cookies may be used in addition to technically necessary cookies. By clicking on "Agree and continue", you declare your consent to the use of the aforementioned cookies. Here you can make detailed settings or revoke your consent (in part if necessary) with effect for the future. For further information, please refer to our Privacy Policy .