Skip to content

chore(ci): harden and organize #775

chore(ci): harden and organize

chore(ci): harden and organize #775

Workflow file for this run

name: Lint
on:
pull_request:
push:
branches: [main]
jobs:
sqlfluff:
name: SQLFluff
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "3.12"
- name: Install SQLFluff
run: pip install sqlfluff
- name: Get changed SQL files
id: changed-files
uses: tj-actions/changed-files@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
with:
files: |
**/*.sql
- name: Run SQLFluff on changed files
if: steps.changed-files.outputs.any_changed == 'true'
run: |
echo "Changed files: $ALL_CHANGED_FILES"
sqlfluff lint $ALL_CHANGED_FILES
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
- name: Skip SQLFluff (no SQL files changed)
if: steps.changed-files.outputs.any_changed == 'false'
run: echo "No SQL files changed, skipping SQLFluff"
- uses: ethanis/nitpicker@e891622bbd9a6ec97a473bcfacfca7332caf2862 # v1.7
with:
nitpicks: ".github/nitpicks.yml"
token: "${{ secrets.GITHUB_TOKEN }}"