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

fatal: --unshallow on a complete repository does not make sense #74

Open oynek opened 1 year ago

oynek commented 1 year ago

When using this GitHub Action, I encounter the following error message:

🐶 Get changed files
  fatal: --unshallow on a complete repository does not make sense

I suspect the error here, but do not understand why this occurs.

Maybe this condition could help solving this:

if $(git rev-parse --is-shallow-repository); then
    ... repository is shallow ...
fi

Source: StackOverflow


My workflow file:

    steps:
      - name: Checkout repo
        uses: actions/checkout@v3

      - name: Lint added and modified .sql files
        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: "lint"
          config: "${{ github.workspace }}/.sqlfluff"
          paths: "${{ github.workspace }}/models"
          extra_requirements_txt: "${{ github.workspace }}/.github/config/requirements.txt"
yu-iskw commented 1 year ago

I am assuming that's because your repository is large. I am thinking what happens, if we use git fetch --prune --depth 10000 --no-tags instead of git fetch --prune --unshallow --no-tags.

MarkEnverus commented 11 months ago

@yu-iskw is there a solution to this? i'm facing the same error?

aballiet commented 10 months ago

@yu-iskw, can you merge the fix you offered ? It solves the problem 👍

aballiet commented 4 months ago

up @yu-iskw ? I need to maintain a fork of your repo to have it 🙏