Skip to content

Commit

Permalink
dont comment plan result
Browse files Browse the repository at this point in the history
  • Loading branch information
raahii committed May 6, 2024
1 parent cbff6e7 commit 4591b51
Showing 1 changed file with 10 additions and 35 deletions.
45 changes: 10 additions & 35 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,49 +110,24 @@ jobs:
- run: gcloud info

# Terraform
- uses: hashicorp/setup-terraform@v3
- name: Set up Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TF_VERSION }}
cli_config_credentials_token: ${{ secrets.TF_API_TOKEN }}
- id: init
- name: Terraform init
id: init
run: terraform init -upgrade
- id: validate
- name: Terraform validate
id: validate
run: terraform validate -no-color
- id: plan
- name: Terraform plan
id: plan
if: github.event_name == 'pull_request'
run: terraform plan -no-color -input=false
continue-on-error: true
- uses: actions/github-script@v7
if: github.event_name == 'pull_request'
env:
PLAN: "${{ steps.plan.outputs.stdout }}"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const output = `#### Terraform Initialization ⚙️\`${{ steps.init.outcome }}\`
#### Terraform Plan 📖\`${{ steps.plan.outcome }}\`
#### Terraform Validation 🤖\`${{ steps.validate.outcome }}\`
<details><summary>Show Plan</summary>
\`\`\`terraform\n
${process.env.PLAN}
\`\`\`
</details>
*Pushed by: @${{ github.actor }}, Action: \`${{ github.event_name }}\`*`;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})
- run: exit 1
if: steps.plan.outcome == 'failure'

- run: terraform apply -auto-approve -input=false
- name: Terraform apply
run: terraform apply -auto-approve -input=false
# if: github.ref == 'refs/heads/main' && github.event_name == 'push'

release-front:
Expand Down

0 comments on commit 4591b51

Please sign in to comment.