Skip to content

About

Set Up Terramate CLI in your GitHub Actions Workflows

Resources

Stars

8 stars

Watchers

4 watching

Forks

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Latest commit

 

History

49 Commits

Folders and files

Repository files navigation

Terramate Github Action

Terramate Action Tests

The terramate-io/terramate-action is a GitHub composite action that sets up Terramate CLI in your GitHub Actions workflows.

  • It downloads a specific version or a asdf configured version of Terramate CLI.
  • It installs Terramate CLI into a user specified path or by default to /usr/local/bin
  • It installs a wrapper script by default so that calls to terramate binary will expose GitHub Action outputs to access the stderr, stderr, and the exitcode of the terramate execution.
  • It allows you to configure a default Terramate Cloud organization to use Terramate Cloud Features like Drift Detection and Stack Health Information.

Compatibility

The action currently only supports ubuntu and macos runners.

Catalyst Support

Terramate Catalyst extends Terramate CLI with additional feature to scale IaC and allow simple self-service also for non experts.

steps:
  - uses: terramate-io/terramate-action@v3
    with:
      version: "0.14.7-beta1"
      use_catalyst: true

Usage

Note

Add use_catalyst: true to any of the examples below to ensure you are using Terramate Catalyst.

The version argument should be used to specify the desired terramate version to install.

steps:
  - uses: terramate-io/terramate-action@v3
    with:
      version: "0.14.0"

The default version is "detect". The terramate version to use needs to be defined in a .tool-versions file as defined by asdf. This is the recommended way to specify the version so updates can be made in a single location.

# file: .tool-versions
terramate 0.14.0
steps:
  - uses: terramate-io/terramate-action@v3
    with:
      version: "detect"

or just

steps:
  - uses: terramate-io/terramate-action@v3

The binary will be installed to /usr/local/bin by default. This location can be changed using the bindir argument:

steps:
  - uses: terramate-io/terramate-action@v3
    with:
      bindir: /usr/local/bin

To configure the default Terramate Cloud Organization set cloud_organization argument to your organization short name:

steps:
  - uses: terramate-io/terramate-action@v3
    with:
      cloud_organization: myorganization

To disable using the optional wrapper script by default the use_wrapper argument can be set to "false":

steps:
  - uses: terramate-io/terramate-action@v3
    with:
      use_wrapper: "false"

Subsequent steps can access outputs when the wrapper script is installed:

steps:
  - uses: terramate-io/terramate-action@v3

  - id: list
    run: terramate list --changed

  - run: echo ${{ steps.list.outputs.stdout }}
  - run: echo ${{ steps.list.outputs.stderr }}
  - run: echo ${{ steps.list.outputs.exitcode }}

License

See the LICENSE file for licensing information.

Terramate

Terramate is a CNCF and Linux Foundation silver member.

CNCF Silver Member logo

About

Set Up Terramate CLI in your GitHub Actions Workflows

Resources

Stars

8 stars

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages