Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.

Commit 3acbdf1

Browse files
authored
Fixing argument handling (#115)
1 parent 7881bd7 commit 3acbdf1

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

examples/output.md

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,24 @@ jobs:
1313
steps:
1414
- name: 'Checkout'
1515
uses: actions/checkout@master
16-
1716
- name: 'Terraform Outputs'
1817
id: terraform
1918
uses: hashicorp/terraform-github-actions@master
2019
with:
2120
tf_actions_version: 0.12.13
2221
tf_actions_subcommand: 'outputs'
2322
tf_actions_working_dir: '.'
24-
2523
- name: 'Use Terraform Output'
2624
run: echo ${{ steps.terraform.outputs.tf_actions_output }}
27-
2825
- name: 'Pull specific database name from outputs'
2926
run: |
30-
# Install jq in this shell
3127
apt-get install jq
32-
33-
# Parse the outputs from the 'Terraform Outputs' step and grab the database name
3428
DBNAME=$(echo ${{ steps.terraform.outputs.tf_actions_output }} | jq -r '.database.value.name')
35-
36-
# Will echo out 'test-database'
3729
echo $DBNAME
3830
```
3931
40-
In this example the `tf_actions_output` would look like:
32+
In this example the `tf_actions_output` would contain the following content.
33+
4134
```json
4235
{
4336
"database": {
@@ -46,4 +39,4 @@ In this example the `tf_actions_output` would look like:
4639
}
4740
}
4841
}
49-
```
42+
```

src/main.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,23 +79,23 @@ function main {
7979
case "${tfSubcommand}" in
8080
fmt)
8181
installTerraform
82-
terraformFmt "${*}"
82+
terraformFmt ${*}
8383
;;
8484
init)
8585
installTerraform
86-
terraformInit "${*}"
86+
terraformInit ${*}
8787
;;
8888
validate)
8989
installTerraform
90-
terraformValidate "${*}"
90+
terraformValidate ${*}
9191
;;
9292
plan)
9393
installTerraform
94-
terraformPlan "${*}"
94+
terraformPlan ${*}
9595
;;
9696
apply)
9797
installTerraform
98-
terraformApply "${*}"
98+
terraformApply ${*}
9999
;;
100100
output)
101101
installTerraform
@@ -108,4 +108,4 @@ function main {
108108
esac
109109
}
110110

111-
main
111+
main "${*}"

0 commit comments

Comments
 (0)