Skip to content

Commit

Permalink
feat(setup): switch to official terramate-setup-action
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiehrhardt committed Jul 5, 2024
1 parent c7804f7 commit e472a07
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ inputs:
description: "The version of Terramate to use"
required: false
default: "latest"
terramate-cloud-organization:
required: false
description: Terramate Cloud organization to use by default when using Terramate Cloud features.
default: ""
terraform-version:
description: "The version of Terraform to use"
required: false
Expand Down Expand Up @@ -115,16 +119,11 @@ inputs:
runs:
using: "composite"
steps:
- name: Setup Go
- uses: terramate-io/terramate-action@v2
if: ${{ inputs.setup == 'true' }}
uses: actions/setup-go@v5
with:
cache: false
- name: Setup Terramate
if: ${{ inputs.setup == 'true' }}
run: |
go install github.com/terramate-io/terramate/cmd/...@${{ inputs.terramate-version }}
shell: bash
version: ${{ inputs.terramate-version }}
cloud_organization: ${{ inputs.terramate-cloud-organization }}
- name: Setup Terraform
if: ${{ inputs.setup == 'true' }}
uses: hashicorp/setup-terraform@v3
Expand Down Expand Up @@ -168,11 +167,11 @@ runs:
shell: bash
- name: Plan
if: >-
${{
${{
( inputs.plan == 'true' ||
( inputs.comment-pull-request == 'true' &&
( inputs.comment-pull-request == 'true' &&
github.event_name == 'pull_request' )
) &&
) &&
steps.list.outputs.stdout != '' }}
run: |
terramate run \
Expand All @@ -185,8 +184,8 @@ runs:
shell: bash
- name: Generate Preview Comment
if: >-
${{
inputs.comment-pull-request == 'true' &&
${{
inputs.comment-pull-request == 'true' &&
github.event_name == 'pull_request'
}}
run: |
Expand Down Expand Up @@ -217,8 +216,8 @@ runs:
shell: bash
- name: Publish Plans
if: >-
${{
inputs.comment-pull-request == 'true' &&
${{
inputs.comment-pull-request == 'true' &&
github.event_name == 'pull_request'
}}
uses: marocchino/sticky-pull-request-comment@v2
Expand All @@ -228,14 +227,14 @@ runs:
path: ${{ inputs.temp-file }}
- name: Apply
if: >-
${{
inputs.apply == 'true' &&
${{
inputs.apply == 'true' &&
steps.list.outputs.stdout != ''
}}
run: |
if [ -f "${{ inputs.terraform-plan-file }}" ]; then
terramate run \
${{ inputs.terramate-args }} \
${{ inputs.terramate-args }} \
${{ inputs.terramate-apply-args }} \
-- terraform apply \
-auto-approve \
Expand All @@ -256,9 +255,9 @@ runs:
shell: bash
- name: Destroy
if: >-
${{
inputs.destroy == 'true' &&
steps.list.outputs.stdout != ''
${{
inputs.destroy == 'true' &&
steps.list.outputs.stdout != ''
}}
run: |
terramate run \
Expand Down

0 comments on commit e472a07

Please sign in to comment.