-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Exit code 0 even if fails to post comment #1187
Comments
Yes.
I see. It makes sense. I'm torn between two options.
|
Thank you for your feedback. |
Thanks for the quick reply! Both options would work for us, the first option would be what I'd intuitively expect to happen but it might be a breaking change for some users. I'd be happy to implement and open a pr for either of the options if you like |
Any updates on this @suzuki-shunsuke? I'd be happy to implement one of the options you mention but I would need to know which one you prefer :) |
Sorry for late reply.
|
As discussed in this suzuki-shunsuke#1187 issue. When the github API returns a non-200 exit code (403 for bad credentials for example or when ratelimited) this is not caught and the cli does not return a non-zero exit code. This can be dangerous in combination with the --skip-no-changes option because users might falsely assume no changes are planned.
tfcmt version
Environment
Overview
Background:
When running tfcmt from our github actions we ocasionally hit github rate limits on the amount of comments we can post. Tfcmt then nicely logs an error about hitting the rate limit but still returns exit code 0. This can be quite dangerous if used in combination with
--skip-no-changes
because when the rate limit is hit no comment is posted and the user might wrongly assume there are no planned changes.Question:
Is it intentional that when an error occurs posting a comment tfcmt exits with 0 as exit code? For example, when no github token is provided a non-zero exit code is provided but if an invalid token is provided tfcmt exits with 0.
If this is intentional it would be very useful to add an option that when set would make tfcmt fail if an error occurs.
I'd be happy to open a PR if it would be welcome!
How to reproduce
tfcmt.yaml
any
Terraform Configuration
any
Executed command and output
Debug output
Expected behaviour
Tfcmt exits with a non zero exit code if it fails to post a comment.
Actual behaviour
Tfcmt fails with a zero exit code when it fails to post a comment.
Important Factoids
No response
Note
No response
The text was updated successfully, but these errors were encountered: