Comments (5)
@wolverian - sorry for the delay, and yes, excellent suggestion!
I recently ran into this problem myself with comments not being deleted due to the title lookup in a matrix run, but the folder problem is also relevant.
from terraform-pr-commenter.
Inspiration for fixing this: I notice that https://github.com/thollander/actions-comment-pull-request uses a hidden HTML comment to distinguish between comments. That might be a pretty nice implementation. We could also simply delegate the commenting to https://github.com/thollander/actions-comment-pull-request (using a composite action) if we don't want to implement the logic ourselves.
from terraform-pr-commenter.
As inspiration, https://github.com/iStreamPlanet/github-actions/tree/main/terraform-actions does (or I should say "did", that action seems non-maintained nowadays) the equivalent with a working directory input to the action.
Whichever of the suggested solutions above sound promising (and would be what I'd need in order to switch from iStreamPlanet into this action). ❤️
from terraform-pr-commenter.
Great suggestion @MPV
As a workaround, I've been using the TF_WORKSPACE
variable to keep track of environment and working directory:
- name: >
Post Plan >> Env: ${{ matrix.project.env }} | Dir: ${{ matrix.project.dir }}
if: always() && github.ref != 'refs/heads/master' && (steps.plan.outcome == 'success' || steps.plan.outcome == 'failure')
uses: robburger/terraform-pr-commenter@v1
env:
TF_WORKSPACE: ${{ format('Env= {0} | Dir= {1}', matrix.project.env, matrix.project.dir) }}
with:
commenter_type: plan
commenter_input: ${{ format('{0}{1}', steps.plan.outputs.stdout, steps.plan.outputs.stderr) }}
commenter_exitcode: ${{ steps.plan.outputs.exitcode }}
Which looks like this. Not great... not terrible...
⚠️ Although, I noticed the action sometimes updates the wrong comment, removing a valid one.
from terraform-pr-commenter.
Worth pointing out that the TF_WORKSPACE
workaround doesn't work for commenter_type
init
nor validate
- the WORKSPACE
variable in the script is only used for commenter_type=="plan"
. This also needs to be fixed.
from terraform-pr-commenter.
Related Issues (20)
- Apply
- Comment update removes the wrong comment HOT 2
- Action does not work with Composite action HOT 1
- Read plan from a file?
- Please add an option input to allow or disallow PR comment overwrite
- Docker build error (unable to select packages) HOT 2
- Terraform fmt comment output wrongly with -diff option
- maximum commenter_input length? HOT 2
- update plan comment summary to show changes
- Option to update comments instead of deleting
- Why is it showing this error? It doesn't print the message in the PR HOT 2
- Empty PR comment for plan with "moved"
- Carry through Exit Code HOT 1
- Getting an error for posting the plan in the PR HOT 1
- deprecated messages in plan output are not displayed in the PR
- Multiple environments, not using Terraform workspaces HOT 2
- Is still repository still maintained? HOT 3
- DOES NOT WORK HOT 9
- Error relocating /usr/bin/curl: curl_easy_nextheader: symbol not found? HOT 1
- New Jimdo fork
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-pr-commenter.