yu-iskw / action-sqlfluff

Run sqlfluff with reviewdog to check or format styles
https://github.com/marketplace/actions/run-sqlfluff-with-reviewdog
MIT License
68 stars 27 forks source link

action-sqlfluff GH action outputs raw format instead of inline code suggestion #79

Closed armaandhull closed 1 year ago

armaandhull commented 1 year ago

@yu-iskw The issue reported in #56 is still present when the diff produced by sqlfluff fix is bigger than a few lines (including a screenshot below). Do we have a fix/workaround for it?

image

The relevant config from the workflow yaml file

    steps:
      - uses: actions/checkout@v2
      - uses: yu-iskw/action-sqlfluff@v3
        id: lint-sql
        with:
          github_token: ${{ secrets.github_token }}
          reporter: github-pr-review
          sqlfluff_version: "1.4.5"
          sqlfluff_command: "fix"
          config: "${{ github.workspace }}/.sqlfluff"
          paths: "${{ github.workspace }}/models"
          extra_requirements_txt: "${{ github.workspace }}/requirements.txt"
      - name: "Show outputs (Optional)"
        shell: bash
        run: |
          echo '${{ steps.lint-sql.outputs.sqlfluff-results }}' | jq -r '.'
          echo '${{ steps.lint-sql.outputs.sqlfluff-results-rdjson }}' | jq -r '.'
armaandhull commented 1 year ago

This is not an issue with this GH action, the output is in raw format for the lines that are not actually in the PR diff but have been modified by sqlfluff fix command. For lines that are in the PR diff, the GH action performs as expected