Skip to content

Commit cdc5f96

Browse files
ci: ignore SQLFluff annotate failures on fork PRs
Fork tokens cannot create check runs; keep lint green with ignore-unauthorized-error and skip annotate when no concept SQL changed. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 0732860 commit cdc5f96

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/lint_sqlfluff.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
name: SQLFluff
22

3+
# Lints changed mimic-iv/concepts/*.sql on pull requests and posts GitHub
4+
# annotations. permissions + ignore-unauthorized-error keep fork PRs usable.
35
on:
46
- pull_request
57

68
jobs:
79
lint-mimic-iv:
810
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
checks: write
914
steps:
1015
- name: checkout
1116
uses: actions/checkout@v7
@@ -35,8 +40,10 @@ jobs:
3540
shell: bash
3641
run: sqlfluff lint --format github-annotation --annotation-level failure --nofail ${{ steps.get_files_to_lint.outputs.lintees }} > annotations.json
3742
- name: Annotate
43+
if: steps.get_files_to_lint.outputs.lintees != ''
3844
uses: yuzutech/annotations-action@v0.6.0
3945
with:
4046
repo-token: "${{ secrets.GITHUB_TOKEN }}"
4147
title: "SQLFluff Lint"
42-
input: "./annotations.json"
48+
input: "./annotations.json"
49+
ignore-unauthorized-error: true

0 commit comments

Comments
 (0)