yuzutech / annotations-action

GitHub action to create annotations from a JSON file
MIT License
31 stars 15 forks source link

SyntaxError: Unexpected token  in JSON at position 0 #63

Open nvjrepo opened 10 months ago

nvjrepo commented 10 months ago

I got below error when running the package: image

Below is the code i used

      - name: Lint dbt models
        id: sqlfluff_json
        #shell: bash -l {0}
        run: |
          git fetch origin main:main
          git diff main --name-only --diff-filter=d | egrep '^models/.*sql$$' | xargs -r sqlfluff lint --format github-annotation --annotation-level failure --nofail > annotations.json

      - name: Annotate
        uses: yuzutech/annotations-action@v0.4.0
        with:
          repo-token: "${{ secrets.GITHUB_TOKEN }}"
          title: 'lint'
          input: './annotations.json'       
ggrossetie commented 10 months ago

Most likely the annotations.json file does not contain a valid JSON. Try to download it and parse it manually.