Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/userbradley/action-install-terraform

Install Terraform for GitHub Actions
https://github.com/userbradley/action-install-terraform

Last synced: 28 days ago
JSON representation

Install Terraform for GitHub Actions

Awesome Lists containing this project

README

        

# GitHub Action: Install Terraform

This action is designed to install Terraform by using the `provider.tf` version of terraform requested

## Quick Start

```yaml
name: Install terraform with specified version

on: [push]
jobs:
terraform:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Terraform
uses: userbradley/[email protected]
with:
providerFileLocation: "terraform"
```

## Terraform Wrapper

```yaml
name: Install terraform with specified version

on: [push]
jobs:
terraform:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Terraform
uses: userbradley/[email protected]
with:
providerFileLocation: "terraform"
wrapper: true
```

Assumes your directory structure is as below:

```text
.
└── repo
├── .github
│ └── workflows
│ └── install-terraform.yml
└── terraform
├── backend.tf
├── main.tf
└── provider.tf
```

The workflow will inspect the `provider.tf` file and install the required terraform version as specified in

```hcl
terraform {
required_version = "1.5.3"
}
```

## Inputs

| Input Name | Required | Default Value | Example |
|------------------------|----------|-----------------------|----------------------------------|
| `providerFileLocation` | `no` | `terraform/templates` | `terraform/deployments/puppy-ui` |
| `wrapper` | `no` | `false` | `true` |

---

Created by Bradley