mirror of
https://github.com/hashicorp/setup-terraform.git
synced 2025-12-16 16:42:35 +00:00
Wrap the tf plan output so it is more readable in the PR (#10)
* Wrap the tf plan output so it is more readable in the PR * Remove extra period. Co-authored-by: Matthew Sanabria <24284972+sudomateo@users.noreply.github.com> Co-authored-by: Matthew Sanabria <24284972+sudomateo@users.noreply.github.com>
This commit is contained in:
parent
3301b9a828
commit
813167dada
1 changed files with 13 additions and 11 deletions
|
|
@ -92,15 +92,17 @@ steps:
|
||||||
- uses: actions/github-script@0.9.0
|
- uses: actions/github-script@0.9.0
|
||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
env:
|
env:
|
||||||
STDOUT: "```${{ steps.plan.outputs.stdout }}```"
|
STDOUT: "```terraform\n${{ steps.plan.outputs.stdout }}```"
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
|
const output = `<details><summary>tf plan:</summary>\n\n${process.env.STDOUT}\n\n</details>`;
|
||||||
|
|
||||||
github.issues.createComment({
|
github.issues.createComment({
|
||||||
issue_number: context.issue.number,
|
issue_number: context.issue.number,
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
body: process.env.STDOUT
|
body: output
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -124,7 +126,7 @@ This action does not configure any outputs directly. However, when the `terrafor
|
||||||
|
|
||||||
- `stderr` - The STDERR stream of the call to the `terraform` binary.
|
- `stderr` - The STDERR stream of the call to the `terraform` binary.
|
||||||
|
|
||||||
- `exitcode` - The exit code of the call to the `terraform` binary..
|
- `exitcode` - The exit code of the call to the `terraform` binary.
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue