Setting up github actions SQL linting

459 views Asked by At

I am trying to setup a simple github actions workflow for sql linting using sqlfluff package. here is sunrise movement workflow which is simple and clean.

name: Lint Models

on: [pull_request]

jobs:
  lint-models:
    runs-on: ubuntu-latest
    steps:
      - uses: "actions/checkout@v2"
      - uses: "actions/setup-python@v2"
        with:
            python-version: "3.8"
      - name: Install SQLFluff
        run: "pip install sqlfluff==0.12.0"
      - name: Lint models
        run: "sqlfluff lint models"

When I tried to run it in github actions, it is giving me the following error message. Not quite sure why it is throwing error. Help is appreciated as I am trying to learn github acitons for the first time. Error

1

There are 1 answers

0
Barry Pollard On

You have this:

        run: "sqlfluff lint models"

This says to lint the directory called models. The directory does not exist in your repo (is it a sub folder?).