-
Notifications
You must be signed in to change notification settings - Fork 64
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
.... not writing as not part of the current PR #54
Comments
I've been alerted to an issue where changes to variables don't show up in the commented PR. Does that sound like a similar scenario? I'm guessing its not a publicly viewable repo? |
@owenrumney I think the issue is that when using the If I understand it correctly, when providing a path to tfsec CLI, the output filename would be a relative path from that tfsec-pr-commenter-action/vendor/github.com/owenrumney/go-github-pr-commenter/commenter/commenter.go Line 159 in 1015a39
and that's where causing this issue, I guess. |
having the same issue here, fresh PR with files that are supposedly not good but are new as of this PR workflow:
I've changed from using Workflow:
These have the same problem:
|
I think this is due to a change in the tfsec filesystem scanning. the paths have changed so #63 might be the solution. I'll have a closer look |
Some debugging on a private repo with name
In this repo, I have terraform files in a subfolder
However, it fails to process the comment:
Looking at https://github.com/aquasecurity/tfsec-pr-commenter-action/blob/main/cmd/commenter/commenter.go#L51 it seems And some replacements done here at https://github.com/aquasecurity/tfsec-pr-commenter-action/blob/main/cmd/commenter/commenter.go#L54:
But filename in yet, the entrypoint.sh writes:
so even though I'm getting the above |
I found it a little painful to debug so tried adding some meaningful output in #64 😅 it is difficult to reproduce though, between local docker and GitHub action 😞 🤦 🤦 🤦 seems my change actually wasn't part of the PR, just adding something new explicitly and behold the comments got added 🤦 |
I have been playing around with debugging this bad boy locally and found out that it points to the function that determines ( hardcoded for us ) if the file being commented on is There might be more the the whole setup than just this - but I decided to quickly write up my own action using tfsec with JQ and other commenting framework 😎 as at the end I never got this one to run for me |
Hi, I have one PR with one commit and new resources created purposely to test the tool in this commit, in particular two s3 buckets without encryption. When I compare changes in the PR I can clearly see the new S3 buckets resources defined for this only commit. But I still get the error. I tried using parameters like working_directory for the action or adding the extra command --force-all-dirs but still, I am getting the message “not writing as not part of the current PR”. |
Confirmed. The issue still exists and is really annoying, since it allows non-compliant resources to pass. |
Confirmed. The issue still exists |
Integrated the commenter in my pipeline. It finds issues after some tweaking of the working directory.
But now it doenst write them to the PR as a comment. It keeps saying that the issue found is not part of the PR.
I've explicitly made an extea change to the file (keyvault.tf) in this case but that still results in the same logging output.
Any ideas?
The text was updated successfully, but these errors were encountered: