Skip to content

Commit

Permalink
Merge pull request #5 from caiocsgomes/fix-remove-pr-update-tf-apply
Browse files Browse the repository at this point in the history
fix: remove pr update from tf apply
  • Loading branch information
caiocsgomes authored Apr 25, 2024
2 parents e089f72 + 0bc3e94 commit e5d8eab
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions .github/workflows/terraform-apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,29 +32,5 @@ jobs:
run: terraform init
working-directory: terraform/environments/prod
- name: terraform apply
run: terraform apply -auto-approve > ${GITHUB_WORKSPACE}/apply.out
run: terraform apply -auto-approve
working-directory: terraform/environments/prod
- name: update PR with apply
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const apply_file = fs.readFileSync('${GITHUB_WORKSPACE}/apply.out', 'utf8').toString();
const output = `### Terraform Apply
<details><summary>Show Output</summary>
\`\`\`diff
${apply_file}
\`\`\`
</details>`;
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
})

0 comments on commit e5d8eab

Please sign in to comment.