Giter Site home page Giter Site logo

Comments (5)

robburger avatar robburger commented on August 11, 2024 2

@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.

JensRantil avatar JensRantil commented on August 11, 2024 1

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.

MPV avatar MPV commented on August 11, 2024

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.

marcellovictorino avatar marcellovictorino commented on August 11, 2024

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...

image

⚠️ Although, I noticed the action sometimes updates the wrong comment, removing a valid one.

from terraform-pr-commenter.

JensRantil avatar JensRantil commented on August 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.