Skip to content

Commit 4140987

Browse files
authored
Merge pull request #4 from analyticsMD/action-install-updates
DEVOPS-13920: Action install updates
2 parents 4dc1649 + cfe9e08 commit 4140987

1 file changed

Lines changed: 33 additions & 27 deletions

File tree

action.yml

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ inputs:
4545
description: "Enable installed dependency caching. Default: 'true'"
4646
default: 'true'
4747
required: false
48+
install-dependencies:
49+
description: "Whether to install dependencies with Aqua. If false, it is assumed that the runner already has the necessary dependencies installed. Default: 'true'"
50+
required: false
51+
default: 'true'
4852
token:
4953
description:
5054
Used to pull node distributions for Atmos from Cloud Posse's GitHub repository. Since there's a default, this is typically
@@ -63,10 +67,10 @@ outputs:
6367
runs:
6468
using: "composite"
6569
steps:
66-
# - name: Install Node
67-
# uses: actions/setup-node@v4
68-
# with:
69-
# node-version: 20
70+
- name: Install Node
71+
uses: actions/setup-node@v4
72+
with:
73+
node-version: 20
7074

7175
- name: Checkout
7276
if: ${{ inputs.skip-checkout != 'true' }}
@@ -79,12 +83,13 @@ runs:
7983
run: |-
8084
echo "ATMOS_CLI_CONFIG_PATH=$(realpath ${{ inputs.atmos-config-path }})" >> $GITHUB_ENV
8185
82-
# - name: Install Atmos
83-
# uses: cloudposse/github-action-setup-atmos@v2
84-
# with:
85-
# atmos-version: ${{ inputs.atmos-version }}
86-
# token: ${{ inputs.token }}
87-
# install-wrapper: false
86+
- name: Install Atmos
87+
uses: cloudposse/github-action-setup-atmos@v2
88+
if: ${{ inputs.install-dependencies == 'true' }}
89+
with:
90+
atmos-version: ${{ inputs.atmos-version }}
91+
token: ${{ inputs.token }}
92+
install-wrapper: false
8893

8994
- name: Get atmos settings
9095
id: atmos-settings
@@ -198,23 +203,24 @@ runs:
198203
# Clean up large variable to free memory
199204
unset COMPONENT_CONFIG
200205
201-
# - name: Install Terraform
202-
# if: ${{ fromJson(steps.atmos-settings.outputs.settings).terraform-version != '' && fromJson(steps.atmos-settings.outputs.settings).terraform-version != 'null' }}
203-
# uses: hashicorp/setup-terraform@v3
204-
# with:
205-
# terraform_version: ${{ fromJson(steps.atmos-settings.outputs.settings).terraform-version }}
206-
# terraform_wrapper: false
206+
- name: Install Terraform
207+
if: ${{ inputs.install-dependencies == 'true' && fromJson(steps.atmos-settings.outputs.settings).terraform-version != '' && fromJson(steps.atmos-settings.outputs.settings).terraform-version != 'null' }}
208+
uses: hashicorp/setup-terraform@v3
209+
with:
210+
terraform_version: ${{ fromJson(steps.atmos-settings.outputs.settings).terraform-version }}
211+
terraform_wrapper: false
207212

208-
# - name: Install Dependencies
209-
# uses: cloudposse-github-actions/install-gh-releases@v1
210-
# with:
211-
# cache: ${{ inputs.cache-dependencies }}
212-
# config: |-
213-
# opentofu/opentofu:
214-
# tag: ${{ startsWith(fromJson(steps.atmos-settings.outputs.settings).opentofu-version, 'v') && fromJson(steps.atmos-settings.outputs.settings).opentofu-version || format('v{0}', fromJson(steps.atmos-settings.outputs.settings).opentofu-version) }}
215-
# skip: ${{ fromJson(steps.atmos-settings.outputs.settings).opentofu-version == '' || fromJson(steps.atmos-settings.outputs.settings).opentofu-version == 'null' }}
216-
# suzuki-shunsuke/tfcmt: v4.14.0
217-
# terraform-docs/terraform-docs: v0.18.0
213+
- name: Install Dependencies
214+
if: ${{ inputs.install-dependencies == 'true' }}
215+
uses: cloudposse-github-actions/install-gh-releases@v1
216+
with:
217+
cache: ${{ inputs.cache-dependencies }}
218+
config: |-
219+
opentofu/opentofu:
220+
tag: ${{ startsWith(fromJson(steps.atmos-settings.outputs.settings).opentofu-version, 'v') && fromJson(steps.atmos-settings.outputs.settings).opentofu-version || format('v{0}', fromJson(steps.atmos-settings.outputs.settings).opentofu-version) }}
221+
skip: ${{ fromJson(steps.atmos-settings.outputs.settings).opentofu-version == '' || fromJson(steps.atmos-settings.outputs.settings).opentofu-version == 'null' }}
222+
suzuki-shunsuke/tfcmt: v4.14.0
223+
terraform-docs/terraform-docs: v0.18.0
218224
219225
- name: Configure Plan AWS Credentials
220226
uses: aws-actions/configure-aws-credentials@v4
@@ -352,7 +358,7 @@ runs:
352358
fi
353359
354360
- name: Setup Infracost
355-
if: env.INFRACOST_ENABLED == 'true'
361+
if: ${{ inputs.install-dependencies == 'true' && env.INFRACOST_ENABLED == 'true' }}
356362
uses: infracost/actions/setup@v3
357363
with:
358364
api-key: ${{ inputs.infracost-api-key }}

0 commit comments

Comments
 (0)