{"id":15642523,"url":"https://github.com/yu-iskw/action-sqlfluff","last_synced_at":"2025-04-14T10:33:16.853Z","repository":{"id":38118003,"uuid":"440748395","full_name":"yu-iskw/action-sqlfluff","owner":"yu-iskw","description":"Run sqlfluff with reviewdog to check or format styles","archived":false,"fork":false,"pushed_at":"2024-04-14T23:24:58.000Z","size":434,"stargazers_count":63,"open_issues_count":14,"forks_count":23,"subscribers_count":6,"default_branch":"main","last_synced_at":"2024-04-17T14:29:54.998Z","etag":null,"topics":["ci","dbt","github-actions","lint","linter","reviewdog","sql","sqlfluff"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/run-sqlfluff-with-reviewdog","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yu-iskw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"yu-iskw"}},"created_at":"2021-12-22T05:52:22.000Z","updated_at":"2024-05-30T08:29:56.839Z","dependencies_parsed_at":"2023-02-16T16:15:58.317Z","dependency_job_id":"163efdbb-5fd6-4a91-ab07-81385a4bfcfc","html_url":"https://github.com/yu-iskw/action-sqlfluff","commit_stats":{"total_commits":34,"total_committers":7,"mean_commits":4.857142857142857,"dds":"0.20588235294117652","last_synced_commit":"a28280f53bbb888a7a1c8d560c01b32b97269198"},"previous_names":[],"tags_count":42,"template":false,"template_full_name":"reviewdog/action-composite-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yu-iskw%2Faction-sqlfluff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yu-iskw%2Faction-sqlfluff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yu-iskw%2Faction-sqlfluff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yu-iskw%2Faction-sqlfluff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yu-iskw","download_url":"https://codeload.github.com/yu-iskw/action-sqlfluff/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248862808,"owners_count":21173888,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","dbt","github-actions","lint","linter","reviewdog","sql","sqlfluff"],"created_at":"2024-10-03T11:56:37.160Z","updated_at":"2025-04-14T10:33:16.845Z","avatar_url":"https://github.com/yu-iskw.png","language":"Shell","funding_links":["https://github.com/sponsors/yu-iskw"],"categories":[],"sub_categories":[],"readme":"# action-sqlfluff\n\n\u003c!-- TODO: replace reviewdog/yu-iskw/action-sqlfluff with your repo name --\u003e\n\n[![Test](https://github.com/yu-iskw/action-sqlfluff/workflows/Test/badge.svg)](https://github.com/yu-iskw/action-sqlfluff/actions?query=workflow%3ATest)\n[![reviewdog](https://github.com/yu-iskw/action-sqlfluff/workflows/reviewdog/badge.svg)](https://github.com/yu-iskw/action-sqlfluff/actions?query=workflow%3Areviewdog)\n[![depup](https://github.com/yu-iskw/action-sqlfluff/workflows/depup/badge.svg)](https://github.com/yu-iskw/action-sqlfluff/actions?query=workflow%3Adepup)\n[![release](https://github.com/yu-iskw/action-sqlfluff/workflows/release/badge.svg)](https://github.com/yu-iskw/action-sqlfluff/actions?query=workflow%3Arelease)\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/yu-iskw/action-sqlfluff?logo=github\u0026sort=semver)](https://github.com/yu-iskw/action-sqlfluff/releases)\n[![action-bumpr supported](https://img.shields.io/badge/bumpr-supported-ff69b4?logo=github\u0026link=https://github.com/haya14busa/action-bumpr)](https://github.com/haya14busa/action-bumpr)\n\nThis is a github action to lint and fix SQL with [sqlfluff](https://github.com/sqlfluff/sqlfluff).\nThe action has the two modes corresponding to `sqlfluff lint` and `sqlfluff fix`.\nOne is to automatically leaves comments about SQL violation using [reviewdog](https://github.com/reviewdog/reviewdog)\nThe other is to automatically suggests code formatting on github pull request with reviewdog too.\n\n## Lint mode\n\nThe lint mode leaves comments on github pull requests.\nComments are pointed out by sqlfluff.\n![github-pr-review demo (lint)](./docs/images/github-pr-review-demo-lint.png)\n\n## Fix mode\n\nThe fix mode suggests code formatting based on `sqlfluff fix`.\n![github-pr-review demo (fix)](./docs/images/github-pr-review-demo-fix.png)\n\n## Example\n\n```yaml\nname: sqlfluff with reviewdog\non:\n  pull_request:\njobs:\n  test-check:\n    name: runner / sqlfluff (github-check)\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n      - uses: yu-iskw/action-sqlfluff@v4\n        id: lint-sql\n        with:\n          github_token: ${{ secrets.github_token }}\n          reporter: github-pr-review\n          sqlfluff_version: \"3.3.1\"\n          sqlfluff_command: \"fix\" # Or \"lint\"\n          config: \"${{ github.workspace }}/.sqlfluff\"\n          paths: \"${{ github.workspace }}/models\"\n      - name: \"Show outputs (Optional)\"\n        shell: bash\n        run: |\n          echo '${{ steps.lint-sql.outputs.sqlfluff-results }}' | jq -r '.'\n          echo '${{ steps.lint-sql.outputs.sqlfluff-results-rdjson }}' | jq -r '.'\n```\n\n## Input\n\n```yaml\ninputs:\n  github_token:\n    description: \"GITHUB_TOKEN\"\n    required: true\n    default: \"${{ github.token }}\"\n  github_base_ref:\n    description: \"Pull request target branch name\"\n    required: false\n    default: \"${{ github.base_ref }}\"\n  working-directory:\n    description: \"working directory\"\n    required: false\n    default: \"${{ github.workspace }}\"\n  ### Flags for reviewdog ###\n  level:\n    description: \"Report level for reviewdog [info,warning,error]\"\n    required: false\n    default: \"error\"\n  reporter:\n    description: \"Reporter of reviewdog command [github-check,github-pr-review].\"\n    required: false\n    default: \"github-check\"\n  filter_mode:\n    description: |\n      Filtering mode for the reviewdog command [added,diff_context,file,nofilter].\n      Default is file.\n    required: false\n    default: \"file\"\n  fail_on_error:\n    description: |\n      Exit code for reviewdog when errors are found [true,false]\n      Default is `false`.\n    required: false\n    default: \"false\"\n  reviewdog_version:\n    description: \"reviewdog version\"\n    required: false\n    default: \"v0.20.2\"\n  ### Flags for sqlfluff ###\n  sqlfluff_version:\n    description: |\n      sqlfluff version. Use the latest version if not set.\n    required: false\n    default: \"3.2.5\"\n  sqlfluff_command:\n    description: \"The sub command of sqlfluff. One of lint and fix\"\n    required: false\n    default: \"lint\"\n  paths:\n    description: |\n      PATH is the path to a sql file or directory to lint.\n      This can be either a file ('path/to/file.sql'), a path ('directory/of/sql/files'), a single ('-') character to indicate reading from *stdin* or a dot/blank ('.'/' ') which will be interpreted like passing the current working directory as a path argument.\n    required: true\n  file_pattern:\n    description: \"The regular expression to filter checked files\"\n    required: false\n    default: '\\.sql$'\n  encoding:\n    description: \"Specifiy encoding to use when reading and writing files. Defaults to autodetect.\"\n    required: false\n    default: \"\"\n  config:\n    description: |\n      Include additional config file.\n      By default the config is generated from the standard configuration files described in the documentation.\n      This argument allows you to specify an additional configuration file that overrides the standard configuration files.\n      N.B. cfg format is required.\n    required: false\n    default: \"\"\n  exclude-rules:\n    description: |\n      Exclude specific rules.\n      For example specifying –exclude-rules L001 will remove rule L001 (Unnecessary trailing whitespace) from the set of considered rules.\n      This could either be the allowlist, or the general set if there is no specific allowlist.\n      Multiple rules can be specified with commas e.g. –exclude-rules L001,L002 will exclude violations of rule L001 and rule L002.\n    required: false\n    default: \"\"\n  rules:\n    description: |\n      Narrow the search to only specific rules.\n      For example specifying –rules L001 will only search for rule L001 (Unnecessary trailing whitespace).\n      Multiple rules can be specified with commas e.g. –rules L001,L002 will specify only looking for violations of rule L001 and rule L002.\n    required: false\n    default: \"\"\n  templater:\n    description: \"The templater to use\"\n    required: false\n    default: \"\"\n  disable-noqa:\n    description: \"Set this flag to ignore inline noqa comments.\"\n    required: false\n    default: \"\"\n  dialect:\n    description: \"The dialect of SQL to lint\"\n    required: false\n    default: \"\"\n  processes:\n    description: \"The number of parallel processes to run.\"\n    required: false\n    default: \"2\"\n  extra_requirements_txt:\n    description: |\n      A path to your custom `requirements.txt` to install extra modules for your dbt adapters.\n      Please make sure not to contain `sqlfluff` and its dependent packages, because the action can be broken by the conflicts.\n    required: false\n    default: \"\"\n```\n\n## Outputs\n\nThe outputs are available only when the `sqlfluff_command` input is `lint`.\n\n```yaml\noutputs:\n  sqlfluff-results:\n    description: \"The JSON object string of sqlfluff results\"\n    value: ${{ steps.sqlfluff-with-reviewdog-in-composite.outputs.sqlfluff-results }}\n  sqlfluff-exit-code:\n    description: \"The exit code of sqlfluff\"\n    value: ${{ steps.sqlfluff-with-reviewdog-in-composite.outputs.sqlfluff-exit-code }}\n  sqlfluff-results-rdjson:\n    description: \"The JSON object string of sqlfluff results\"\n    value: ${{ steps.sqlfluff-with-reviewdog-in-composite.outputs.sqlfluff-results-rdjson }}\n  reviewdog-return-code:\n    description: \"The exit code of reviewdog\"\n    value: ${{ steps.sqlfluff-with-reviewdog-in-composite.outputs.reviewdog-return-code }}\n```\n\n## Development\n\n### Release\n\n#### [haya14busa/action-bumpr](https://github.com/haya14busa/action-bumpr)\n\nYou can bump version on merging Pull Requests with specific labels (bump:major,bump:minor,bump:patch).\nPushing tag manually by yourself also work.\n\n#### [haya14busa/action-update-semver](https://github.com/haya14busa/action-update-semver)\n\nThis action updates major/minor release tags on a tag push. e.g. Update v1 and v1.2 tag when released v1.2.3.\nref: \u003chttps://help.github.com/en/articles/about-actions#versioning-your-action\u003e\n\n### Lint - reviewdog integration\n\nThis reviewdog action template itself is integrated with reviewdog to run lints\nwhich is useful for Docker container based actions.\n\n![reviewdog integration](https://user-images.githubusercontent.com/3797062/72735107-7fbb9600-3bde-11ea-8087-12af76e7ee6f.png)\n\nSupported linters:\n\n- [reviewdog/action-shellcheck](https://github.com/reviewdog/action-shellcheck)\n- [reviewdog/action-hadolint](https://github.com/reviewdog/action-hadolint)\n- [reviewdog/action-misspell](https://github.com/reviewdog/action-misspell)\n\n### Dependencies Update Automation\n\nThis repository uses [reviewdog/action-depup](https://github.com/reviewdog/action-depup) to update\nreviewdog version.\n\n![reviewdog depup demo](https://user-images.githubusercontent.com/3797062/73154254-170e7500-411a-11ea-8211-912e9de7c936.png)\n\n## Contributors\n\n\u003c!-- readme: contributors -start --\u003e\n\u003ctable\u003e\n\t\u003ctbody\u003e\n\t\t\u003ctr\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/yu-iskw\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/1523515?v=4\" width=\"100;\" alt=\"yu-iskw\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eYu Ishikawa\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/vgw-chriskruger\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/118869997?v=4\" width=\"100;\" alt=\"vgw-chriskruger\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eChris Kruger\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/onesuper\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/977633?v=4\" width=\"100;\" alt=\"onesuper\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eDreamsome\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/snyk-bot\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/19733683?v=4\" width=\"100;\" alt=\"snyk-bot\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eSnyk Bot\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n            \u003ctd align=\"center\"\u003e\n                \u003ca href=\"https://github.com/kieronellis\"\u003e\n                    \u003cimg src=\"https://avatars.githubusercontent.com/u/69465049?v=4\" width=\"100;\" alt=\"kieronellis\"/\u003e\n                    \u003cbr /\u003e\n                    \u003csub\u003e\u003cb\u003eNull\u003c/b\u003e\u003c/sub\u003e\n                \u003c/a\u003e\n            \u003c/td\u003e\n\t\t\u003c/tr\u003e\n\t\u003ctbody\u003e\n\u003c/table\u003e\n\u003c!-- readme: contributors -end --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyu-iskw%2Faction-sqlfluff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyu-iskw%2Faction-sqlfluff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyu-iskw%2Faction-sqlfluff/lists"}