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

Fixing argument handling #115

Merged
merged 1 commit into from
Nov 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions examples/output.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,24 @@ jobs:
steps:
- name: 'Checkout'
uses: actions/checkout@master

- name: 'Terraform Outputs'
id: terraform
uses: hashicorp/terraform-github-actions@master
with:
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": {
Expand All @@ -46,4 +39,4 @@ In this example the `tf_actions_output` would look like:
}
}
}
```
```
12 changes: 6 additions & 6 deletions src/main.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -108,4 +108,4 @@ function main {
esac
}

main
main "${*}"