Skip to content

Commit 2a84bc7

Browse files
committed
[v1.6.0] Upgrade TF to 1.9.0 & Remove plan cleaning last lines
1 parent 72c6e45 commit 2a84bc7

File tree

6 files changed

+24
-16
lines changed

6 files changed

+24
-16
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## v1.6.0
4+
5+
- Bump to Terraform v1.9.0 internally (fixes `curl` problem)
6+
- Removes the cleaning of plan's last lines
7+
38
## v1.5.0
49

510
- Bump to Terraform v1.0.6 internally (only affects `fmt`)

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
FROM hashicorp/terraform:1.0.6
1+
FROM hashicorp/terraform:1.9.0
22

3-
LABEL repository="https://github.com/robburger/terraform-pr-commenter" \
4-
homepage="https://github.com/robburger/terraform-pr-commenter" \
3+
LABEL repository="https://github.com/juan-vg/terraform-pr-commenter" \
4+
homepage="https://github.com/juan-vg/terraform-pr-commenter" \
55
maintainer="Rob Burger" \
66
com.github.actions.name="Terraform PR Commenter" \
77
com.github.actions.description="Adds opinionated comments to a PR from Terraform fmt/init/plan output" \

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020 Rob Burger
3+
Copyright (c) 2020 Rob Burger & Juan-VG
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
Adds opinionated comments to PR's based on Terraform `fmt`, `init`, `plan` and `validate` outputs.
44

5+
> This project was forked from <https://github.com/robburger/terraform-pr-commenter> project, originally created by [
6+
Rob Burger](https://github.com/robburger).
7+
58
## Summary
69

710
This Docker-based GitHub Action is designed to work in tandem with [hashicorp/setup-terraform](https://github.com/hashicorp/setup-terraform) with the **wrapper enabled**, taking the output from a `fmt`, `init`, `plan` or `validate`, formatting it and adding it to a pull request. Any previous comments from this Action are removed to keep the PR timeline clean.
@@ -15,7 +18,7 @@ Support (for now) is [limited to Linux](https://help.github.com/en/actions/creat
1518
This action can only be run after a Terraform `fmt`, `init`, `plan` or `validate` has completed, and the output has been captured. Terraform rarely writes to `stdout` and `stderr` in the same action, so we concatenate the `commenter_input`:
1619

1720
```yaml
18-
- uses: robburger/terraform-pr-commenter@v1
21+
- uses: juan-vg/terraform-pr-commenter@v1
1922
env:
2023
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2124
with:
@@ -55,7 +58,7 @@ jobs:
5558
uses: actions/checkout@v2
5659
...
5760
- name: Post Plan
58-
uses: robburger/terraform-pr-commenter@v1
61+
uses: juan-vg/terraform-pr-commenter@v1
5962
env:
6063
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6164
EXPAND_SUMMARY_DETAILS: 'true' # Override global environment variable; expand details just for this step
@@ -103,7 +106,7 @@ jobs:
103106
104107
- name: Post Format
105108
if: always() && github.ref != 'refs/heads/master' && (steps.fmt.outcome == 'success' || steps.fmt.outcome == 'failure')
106-
uses: robburger/terraform-pr-commenter@v1
109+
uses: juan-vg/terraform-pr-commenter@v1
107110
with:
108111
commenter_type: fmt
109112
commenter_input: ${{ format('{0}{1}', steps.fmt.outputs.stdout, steps.fmt.outputs.stderr) }}
@@ -115,7 +118,7 @@ jobs:
115118
116119
- name: Post Init
117120
if: always() && github.ref != 'refs/heads/master' && (steps.init.outcome == 'success' || steps.init.outcome == 'failure')
118-
uses: robburger/terraform-pr-commenter@v1
121+
uses: juan-vg/terraform-pr-commenter@v1
119122
with:
120123
commenter_type: init
121124
commenter_input: ${{ format('{0}{1}', steps.init.outputs.stdout, steps.init.outputs.stderr) }}
@@ -127,7 +130,7 @@ jobs:
127130
128131
- name: Post Validate
129132
if: always() && github.ref != 'refs/heads/master' && (steps.validate.outcome == 'success' || steps.validate.outcome == 'failure')
130-
uses: robburger/terraform-pr-commenter@v1
133+
uses: juan-vg/terraform-pr-commenter@v1
131134
with:
132135
commenter_type: validate
133136
commenter_input: ${{ format('{0}{1}', steps.validate.outputs.stdout, steps.validate.outputs.stderr) }}
@@ -139,7 +142,7 @@ jobs:
139142
140143
- name: Post Plan
141144
if: always() && github.ref != 'refs/heads/master' && (steps.plan.outcome == 'success' || steps.plan.outcome == 'failure')
142-
uses: robburger/terraform-pr-commenter@v1
145+
uses: juan-vg/terraform-pr-commenter@v1
143146
with:
144147
commenter_type: plan
145148
commenter_input: ${{ format('{0}{1}', steps.plan.outputs.stdout, steps.plan.outputs.stderr) }}
@@ -182,7 +185,7 @@ jobs:
182185
183186
- name: Post Init - ${{ matrix['workspace'] }}
184187
if: always() && github.ref != 'refs/heads/master' && (steps.init.outcome == 'success' || steps.init.outcome == 'failure')
185-
uses: robburger/terraform-pr-commenter@v1
188+
uses: juan-vg/terraform-pr-commenter@v1
186189
with:
187190
commenter_type: init
188191
commenter_input: ${{ format('{0}{1}', steps.init.outputs.stdout, steps.init.outputs.stderr) }}
@@ -194,7 +197,7 @@ jobs:
194197
195198
- name: Post Plan - ${{ matrix['workspace'] }}
196199
if: always() && github.ref != 'refs/heads/master' && (steps.plan.outcome == 'success' || steps.plan.outcome == 'failure')
197-
uses: robburger/terraform-pr-commenter@v1
200+
uses: juan-vg/terraform-pr-commenter@v1
198201
with:
199202
commenter_type: plan
200203
commenter_input: ${{ format('{0}{1}', steps.plan.outputs.stdout, steps.plan.outputs.stderr) }}
@@ -230,7 +233,7 @@ In English: "Always run this step, but only on a pull request and only when the
230233

231234
## Troubleshooting & Contributing
232235

233-
Feel free to head over to the [Issues](https://github.com/robburger/terraform-pr-commenter/issues) tab to see if the issue you're having has already been reported. If not, [open a new one](https://github.com/robburger/terraform-pr-commenter/issues/new) and be sure to include as much relevant information as possible, including code-samples, and a description of what you expect to be happening.
236+
Feel free to head over to the [Issues](https://github.com/juan-vg/terraform-pr-commenter/issues) tab to see if the issue you're having has already been reported. If not, [open a new one](https://github.com/juan-vg/terraform-pr-commenter/issues/new) and be sure to include as much relevant information as possible, including code-samples, and a description of what you expect to be happening.
234237

235238
## License
236239

action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name: 'Terraform PR Commenter'
1+
name: 'Terraform PR Commenter by Juan-VG'
22
description: 'Adds opinionated comments to a PR from Terraform fmt/init/plan output'
3-
author: 'Rob Burger'
3+
author: 'Juan-VG'
44
branding:
55
icon: 'git-pull-request'
66
color: 'purple'

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ if [[ $COMMAND == 'plan' ]]; then
184184
# Actions: Strip out the refresh section, ignore everything after the 72 dashes, format, colourise and build PR comment.
185185
if [[ $EXIT_CODE -eq 0 || $EXIT_CODE -eq 2 ]]; then
186186
CLEAN_PLAN=$(echo "$INPUT" | sed -r '/^(An execution plan has been generated and is shown below.|Terraform used the selected providers to generate the following execution|No changes. Infrastructure is up-to-date.|No changes. Your infrastructure matches the configuration.|Note: Objects have changed outside of Terraform)$/,$!d') # Strip refresh section
187-
CLEAN_PLAN=$(echo "$CLEAN_PLAN" | sed -r '/Plan: /q') # Ignore everything after plan summary
187+
#CLEAN_PLAN=$(echo "$CLEAN_PLAN" | sed -r '/Plan: /q') # Ignore everything after plan summary ## https://github.com/robburger/terraform-pr-commenter/pull/49/files
188188
CLEAN_PLAN=${CLEAN_PLAN::65300} # GitHub has a 65535-char comment limit - truncate plan, leaving space for comment wrapper
189189
CLEAN_PLAN=$(echo "$CLEAN_PLAN" | sed -r 's/^([[:blank:]]*)([-+~])/\2\1/g') # Move any diff characters to start of line
190190
if [[ $COLOURISE == 'true' ]]; then

0 commit comments

Comments
 (0)