Skip to content

Commit

Permalink
adding tfc action-run github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
chefgs committed Jul 22, 2024
1 parent 54e3961 commit 800502d
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions .github/workflows/tf_cloud_aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,25 @@ jobs:
terraform validate
working-directory: ${{ env.tfcode_path }}

# - name: Terraform Plan
# id: tfplan
# run: |
# echo "** Running Terraform Plan**"
# terraform plan
# # echo "::set-output name=plan_id::tfplan"
# working-directory: ${{ env.tfcode_path }}

- name: Terraform Plan
id: tfplan
run: |
echo "** Running Terraform Plan**"
terraform plan
# echo "::set-output name=plan_id::tfplan"
working-directory: ${{ env.tfcode_path }}
uses: hashicorp/tfc-workflows-github/actions/[email protected]
id: run
with:
workspace: "my-workspace"
plan_only: true
message: "Plan Run from GitHub Actions"
## Can specify hostname,token,organization as direct inputs
hostname: ${{ env.tfc_hostname }}
token: ${{ secrets.TF_API_TOKEN }}
organization: ${{ env.tfc_organisation }}

- name: Terraform Plan Output
uses: hashicorp/tfc-workflows-github/actions/[email protected]
Expand All @@ -63,7 +75,7 @@ jobs:
hostname: ${{ env.tfc_hostname }}
token: ${{ secrets.TF_API_TOKEN }}
organization: ${{ env.tfc_organisation }}
plan: ${{ steps.tfplan.outputs.plan_id }}
plan: ${{ steps.run.outputs.plan_id }}

- name: Reference Plan Output
run: |
Expand Down

0 comments on commit 800502d

Please sign in to comment.