Skip to content

Commit

Permalink
fix: plan output comment
Browse files Browse the repository at this point in the history
  • Loading branch information
tericcabrel committed Aug 4, 2024
1 parent 91bb7d0 commit 7cc2185
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/actions/terraform-apply/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ runs:
terraform_version: 1.9.2

- name: Upload Configuration
uses: hashicorp/tfc-workflows-github/actions/upload-configuration@v1.0.0
uses: hashicorp/tfc-workflows-github/actions/upload-configuration@v1.3.1
id: apply-upload
with:
workspace: ${{ inputs.TF_WORKSPACE }}
directory: ${{ inputs.TF_DIRECTORY }}

- name: Create Apply Run
uses: hashicorp/tfc-workflows-github/actions/create-run@v1.0.0
uses: hashicorp/tfc-workflows-github/actions/create-run@v1.3.1
id: apply-run
with:
workspace: ${{ env.TF_WORKSPACE }}
configuration_version: ${{ steps.apply-upload.outputs.configuration_version_id }}

- name: Apply
uses: hashicorp/tfc-workflows-github/actions/apply-run@v1.0.0
uses: hashicorp/tfc-workflows-github/actions/apply-run@v1.3.1
if: fromJSON(steps.apply-run.outputs.payload).data.attributes.actions.IsConfirmable
id: apply
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/actions/terraform-plan/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ runs:
terraform_version: 1.9.2

- name: Upload Configuration
uses: hashicorp/tfc-workflows-github/actions/upload-configuration@v1.0.0
uses: hashicorp/tfc-workflows-github/actions/upload-configuration@v1.3.1
id: plan-upload
with:
workspace: ${{ inputs.TF_WORKSPACE }}
directory: ${{ inputs.TF_DIRECTORY }}
speculative: true

- name: Create Plan Run
uses: hashicorp/tfc-workflows-github/actions/create-run@v1.0.0
uses: hashicorp/tfc-workflows-github/actions/create-run@v1.3.1
id: plan-run
with:
workspace: ${{ inputs.TF_WORKSPACE }}
configuration_version: ${{ steps.plan-upload.outputs.configuration_version_id }}
plan_only: true

- name: Get Plan Output
uses: hashicorp/tfc-workflows-github/actions/plan-output@v1.0.0
uses: hashicorp/tfc-workflows-github/actions/plan-output@v1.3.1
id: plan-output
with:
plan: ${{ fromJSON(steps.plan-run.outputs.payload).data.relationships.plan.data.id }}
Expand All @@ -56,7 +56,7 @@ runs:
issue_number: context.issue.number,
});
const botComment = comments.find(comment => {
return comment.user.type === 'Bot' && comment.body.includes('HCP Terraform Plan Output')
return comment.user.type === 'Bot' && comment.body.includes('${{ inputs.APP_NAME }} - HCP Terraform Plan Output')
});
const output = `#### ${{ inputs.APP_NAME }} - HCP Terraform Plan Output
\`\`\`
Expand Down

0 comments on commit 7cc2185

Please sign in to comment.