Skip to content

Commit 86cfd27

Browse files
committed
Add initial arm support
1 parent 69e5c1c commit 86cfd27

File tree

3 files changed

+45
-27
lines changed

3 files changed

+45
-27
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ Inputs configure Terraform GitHub Actions to perform different actions.
9090
| tf_actions_comment | Whether or not to comment on GitHub pull requests. Defaults to `true`. | `No` |
9191
| tf_actions_working_dir | The working directory to change into before executing Terragrunt subcommands. Defaults to the root of the GitHub repository. | `No` |
9292
| tf_actions_fmt_write | Whether or not to write `fmt` changes to source files. Defaults to `false`. | `No` |
93+
| tf_actions_architecture | The architecture for running Terraform. Defaults to `amd64`. | `No` |
94+
| tg_actions_architecture | The architecture for running Terragrunt. Defaults to `amd64`. | `No` |
9395

9496
## Outputs
9597

action.yml

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,53 @@
1-
name: 'Terragrunt GitHub Actions'
2-
description: 'Runs Terragrunt commands via GitHub Actions.'
3-
author: 'HashiCorp, Inc. Terraform Team <[email protected]>'
1+
name: "Terragrunt GitHub Actions"
2+
description: "Runs Terragrunt commands via GitHub Actions."
3+
author: "HashiCorp, Inc. Terraform Team <[email protected]>"
44
branding:
5-
icon: 'cloud'
6-
color: 'purple'
5+
icon: "cloud"
6+
color: "purple"
77
inputs:
88
tf_actions_subcommand:
9-
description: 'Terraform or Terragrunt subcommand to execute.'
9+
description: "Terraform or Terragrunt subcommand to execute."
1010
required: true
1111
tf_actions_binary:
12-
description: 'Binary to use. Terraform or Terragrunt'
13-
default: 'terragrunt'
12+
description: "Binary to use. Terraform or Terragrunt"
13+
default: "terragrunt"
1414
tf_actions_version:
15-
description: 'Terraform version to install.'
15+
description: "Terraform version to install."
1616
required: true
17-
default: 'latest'
17+
default: "latest"
1818
tg_actions_version:
19-
description: 'Terragrunt version to install.'
19+
description: "Terragrunt version to install."
2020
required: true
21-
default: 'latest'
21+
default: "latest"
2222
tf_actions_cli_credentials_hostname:
23-
description: 'Hostname for the CLI credentials file.'
24-
default: 'app.terraform.io'
23+
description: "Hostname for the CLI credentials file."
24+
default: "app.terraform.io"
2525
tf_actions_cli_credentials_token:
26-
description: 'Token for the CLI credentials file.'
26+
description: "Token for the CLI credentials file."
2727
tf_actions_comment:
28-
description: 'Whether or not to comment on pull requests.'
28+
description: "Whether or not to comment on pull requests."
2929
default: true
3030
tf_actions_working_dir:
31-
description: 'Terragrunt working directory.'
32-
default: '.'
31+
description: "Terragrunt working directory."
32+
default: "."
3333
tf_actions_fmt_write:
34-
description: 'Write Terragrunt fmt changes to source files.'
34+
description: "Write Terragrunt fmt changes to source files."
3535
default: false
36+
tf_actions_architecture:
37+
description: "The architecture for running Terraform."
38+
default: "amd64"
39+
tg_actions_architecture:
40+
description: "The architecture for running Terragrunt."
41+
default: "amd64"
3642
outputs:
3743
tf_actions_output:
38-
description: 'The Terragrunt outputs in JSON format.'
44+
description: "The Terragrunt outputs in JSON format."
3945
tf_actions_plan_has_changes:
40-
description: 'Whether or not the Terragrunt plan contained changes.'
46+
description: "Whether or not the Terragrunt plan contained changes."
4147
tf_actions_plan_output:
42-
description: 'The Terragrunt plan output.'
48+
description: "The Terragrunt plan output."
4349
tf_actions_fmt_written:
44-
description: 'Whether or not the Terragrunt formatting was written to source files.'
50+
description: "Whether or not the Terragrunt formatting was written to source files."
4551
runs:
46-
using: 'docker'
47-
image: './Dockerfile'
52+
using: "docker"
53+
image: "./Dockerfile"

src/main.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@ function parseInputs {
5151
tfWorkingDir=${INPUT_TF_ACTIONS_WORKING_DIR}
5252
fi
5353

54+
tfArchitecture="amd64"
55+
if [[ -n "${INPUT_TF_ACTIONS_ARCHITECTURE}" ]]; then
56+
tfArchitecture=${INPUT_TF_ACTIONS_ARCHITECTURE}
57+
fi
58+
59+
tgArchitecture="amd64"
60+
if [[ -n "${INPUT_TG_ACTIONS_ARCHITECTURE}" ]]; then
61+
tgArchitecture=${INPUT_TG_ACTIONS_ARCHITECTURE}
62+
fi
63+
5464
tfBinary="terragrunt"
5565
if [[ -n "${INPUT_TF_ACTIONS_BINARY}" ]]; then
5666
tfBinary=${INPUT_TF_ACTIONS_BINARY}
@@ -103,7 +113,7 @@ function installTerraform {
103113
fi
104114
fi
105115

106-
url="https://releases.hashicorp.com/terraform/${tfVersion}/terraform_${tfVersion}_linux_amd64.zip"
116+
url="https://releases.hashicorp.com/terraform/${tfVersion}/terraform_${tfVersion}_linux_${tfArchitecture}.zip"
107117

108118
echo "Downloading Terraform v${tfVersion} (URL: ${url})"
109119
curl -s -S -L -o /tmp/terraform_${tfVersion} ${url}
@@ -134,7 +144,7 @@ function installTerragrunt {
134144
fi
135145
fi
136146

137-
url="https://github.com/gruntwork-io/terragrunt/releases/download/${tgVersion}/terragrunt_linux_amd64"
147+
url="https://github.com/gruntwork-io/terragrunt/releases/download/${tgVersion}/terragrunt_linux_${tgArchitecture}"
138148

139149
echo "Downloading Terragrunt ${tgVersion}"
140150
curl -s -S -L -o /tmp/terragrunt ${url}

0 commit comments

Comments
 (0)