diff --git a/examples/output.md b/examples/output.md index 073fca1e..752f2758 100644 --- a/examples/output.md +++ b/examples/output.md @@ -13,7 +13,6 @@ jobs: steps: - name: 'Checkout' uses: actions/checkout@master - - name: 'Terraform Outputs' id: terraform uses: hashicorp/terraform-github-actions@master @@ -21,23 +20,17 @@ jobs: tf_actions_version: 0.12.13 tf_actions_subcommand: 'outputs' tf_actions_working_dir: '.' - - name: 'Use Terraform Output' run: echo ${{ steps.terraform.outputs.tf_actions_output }} - - name: 'Pull specific database name from outputs' run: | - # Install jq in this shell apt-get install jq - - # Parse the outputs from the 'Terraform Outputs' step and grab the database name DBNAME=$(echo ${{ steps.terraform.outputs.tf_actions_output }} | jq -r '.database.value.name') - - # Will echo out 'test-database' echo $DBNAME ``` -In this example the `tf_actions_output` would look like: +In this example the `tf_actions_output` would contain the following content. + ```json { "database": { @@ -46,4 +39,4 @@ In this example the `tf_actions_output` would look like: } } } -``` \ No newline at end of file +``` diff --git a/src/main.sh b/src/main.sh index 11abfd42..3e810e54 100755 --- a/src/main.sh +++ b/src/main.sh @@ -79,23 +79,23 @@ function main { case "${tfSubcommand}" in fmt) installTerraform - terraformFmt "${*}" + terraformFmt ${*} ;; init) installTerraform - terraformInit "${*}" + terraformInit ${*} ;; validate) installTerraform - terraformValidate "${*}" + terraformValidate ${*} ;; plan) installTerraform - terraformPlan "${*}" + terraformPlan ${*} ;; apply) installTerraform - terraformApply "${*}" + terraformApply ${*} ;; output) installTerraform @@ -108,4 +108,4 @@ function main { esac } -main +main "${*}"