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

The commenter fails with the error "invalid character '/' looking for beginning of value" #17

Open
suomit-pki opened this issue Aug 25, 2021 · 9 comments

Comments

@suomit-pki
Copy link

Hi,

I'm running the latest @main version of the action. When I run it, it fails and in the logs it says:

Starting the github commenter... The commenter failed with the following error: invalid character '/' looking for beginning of value

Looking at the cmd/commenter/commenter.go code and the error message, it seems to come from the JSON-library, so maybe parsing the event.json file or the results.json file fails?

@owenrumney
Copy link
Contributor

Hey @suomit-pki - sorry for the delay in getting to this. Is it still an issue? I think I've seen this when bad output landsin in the results.json so might be worth running again from @main

again, apologies for the delay

@jgrumboe
Copy link

jgrumboe commented Oct 9, 2021

I do get the same error with @main version

@abagayev
Copy link

The same for me, main and previous versions are not working

@jgrumboe
Copy link

I tried 0.1.10 yesterday on a new PR in our private repo and it was working fine again.

@abagayev
Copy link

abagayev commented Nov 4, 2021

@jgrumboe can you please share your workflow?

@jgrumboe
Copy link

jgrumboe commented Nov 4, 2021

Sure.

name: tfsec-pr-commenter
on:
  pull_request:
jobs:
  tfsec:
    name: tfsec PR commenter
    runs-on: ubuntu-latest

    steps:
      - name: Clone repo
        uses: actions/checkout@v2

      - name: tfsec
        uses: aquasecurity/tfsec-pr-commenter-action@v0.1.10
        with:
          github_token: ${{ secrets.GITHUB_ACCESS_TOKEN }}

@abagayev
Copy link

abagayev commented Nov 4, 2021

Thanks for sharing!

So I've investigated my problem and problem was in tfsec code validating. With invalid code style tfsec breaks:

$ tfsec 
tags.tf:50,31-36: Missing attribute separator; Expected a newline or comma to mark the beginning of the next attribute.

And breaks not on JSON format. That's why commenting isn't working.

@jgrumboe
Copy link

jgrumboe commented Nov 4, 2021

Good point! I had only successful code and not tested a tfsec hit ... need to do that.

@erzz
Copy link

erzz commented Jan 16, 2022

<deleted>

I am a moron who forgot to add the checkout step first 😂

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

5 participants