Skip to content

Commit

Permalink
get workspace state
Browse files Browse the repository at this point in the history
  • Loading branch information
italopessoa authored Sep 17, 2024
1 parent 0ce45ff commit 14dbc97
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,19 @@ jobs:
body: output
});
- name: Get output
uses: hashicorp/tfc-workflows-github/actions/workspace-output@v1.3.1
id: output
with:
workspace: ${{ env.TF_WORKSPACE }}

- run: |
echo "Latest Run Status: ${{ steps.output.outputs.outputs }}"
- run: |
echo "Latest: ${{ fromJson(steps.output.outputs.outputs) }}"
vpc_id=$(echo "${{ fromJson(steps.output.outputs.outputs) }}" | jq -r '.[] | select(.name == "vpc_id") | .value')
echo "$vpc_id"
deploy:
needs: [test, terraform-settings]
if: github.ref == 'refs/heads/main'
Expand Down

0 comments on commit 14dbc97

Please sign in to comment.