Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When using plan output file as source, -patch option seems to create a new comment every time #1454

Closed
jamengual opened this issue Nov 1, 2024 · 5 comments

Comments

@jamengual
Copy link

jamengual commented Nov 1, 2024

tfcmt version

4.14.0

Environment

  • OS: linux
  • CPU Architecture: amd64

Overview

when using this strategy :

#!/usr/bin/env bash

set -u

tfcmt plan -- terraform plan 2>&1 | tee result.txt
code=${PIPESTATUS[0]}
tfcmt --output plan.md plan -patch -- bash -c "cat result.txt && exit "$code""

tfcmt seems to post new comments every time. This does not happen when running plan directly without --output as a parameter using the same version.

How to reproduce

in the description

Debug output

$ 

Expected behaviour

to update the last comments

Actual behaviour

it creates a comment every time

Important Factoids

related to : (#1412)

Note

No response

@jamengual jamengual added the bug Something isn't working label Nov 1, 2024
@jamengual
Copy link
Author

#1412

@suzuki-shunsuke suzuki-shunsuke changed the title When using plan output file as source, -path option seems to create a new comment every time When using plan output file as source, -patch option seems to create a new comment every time Nov 1, 2024
@suzuki-shunsuke
Copy link
Owner

suzuki-shunsuke commented Nov 1, 2024

You should use -patch in the first command because it posts a comment to GitHub.
The second command outputs the result to plan.md so -patch option has no meaning.

#!/usr/bin/env bash

set -u

tfcmt plan -patch -- terraform plan 2>&1 | tee result.txt
code=${PIPESTATUS[0]}
tfcmt --output plan.md plan -- bash -c "cat result.txt && exit "$code""

@suzuki-shunsuke suzuki-shunsuke removed the bug Something isn't working label Nov 1, 2024
@jamengual
Copy link
Author

ah, yes, you are correct; I will try that.

@suzuki-shunsuke
Copy link
Owner

@jamengual
Copy link
Author

I can confirm that it worked, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants