Skip to content

Commit

Permalink
support vars
Browse files Browse the repository at this point in the history
  • Loading branch information
sawman committed Dec 17, 2024
1 parent 85eaa1a commit 9e419ea
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: 'Terraform PR'
description: 'GitHub Action for adding `terraform plan` output as a PR comment'
name: "Terraform PR"
description: "GitHub Action for adding `terraform plan` output as a PR comment"
branding:
icon: 'package'
color: 'blue'
icon: "package"
color: "blue"
inputs:
github-token:
description: "GitHub token for commenting on PRs. Defaults to using 'secrets.GITHUB_TOKEN'"
Expand Down Expand Up @@ -85,12 +85,15 @@ runs:
run: |
if [[ '${{ github.ref }}' != 'refs/heads/${{ inputs.apply-branch }}' ]]; then
cd ${{ inputs.path }}
if $TERRAFORM_CLI_PATH/terraform-bin plan -no-color -lock-timeout=60s -lock=${{ inputs.lock-for-plan }} > ${GITHUB_WORKSPACE}/plan.out 2>&1; then
$TERRAFORM_CLI_PATH/terraform-bin plan -out=plan.tfplan -lock-timeout=60s -lock=${{ inputs.lock-for-plan }} 2>&1
PLAN_EXIT_CODE=$?
$TERRAFORM_CLI_PATH/terraform-bin show -no-color plan.tfplan > ${GITHUB_WORKSPACE}/plan.out 2>&1
if [ $PLAN_EXIT_CODE -eq 0 ]; then
echo "plan-outcome=success" >> $GITHUB_OUTPUT
else
echo "plan-outcome=failure" >> $GITHUB_OUTPUT
fi
cat ${GITHUB_WORKSPACE}/plan.out
fi
- name: Create/Update Comment
Expand Down

0 comments on commit 9e419ea

Please sign in to comment.