Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yokawasa/action-sqlcheck
A GitHub Action that automatically identifies anti-patterns in SQL queries using sqlcheck when PR is requested. Please [✩Star] if you're using it!
https://github.com/yokawasa/action-sqlcheck
container github-action github-actions sqlcheck static-analysis
Last synced: 5 days ago
JSON representation
A GitHub Action that automatically identifies anti-patterns in SQL queries using sqlcheck when PR is requested. Please [✩Star] if you're using it!
- Host: GitHub
- URL: https://github.com/yokawasa/action-sqlcheck
- Owner: yokawasa
- License: mit
- Created: 2020-02-23T07:42:33.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-09T02:52:31.000Z (12 months ago)
- Last Synced: 2024-10-01T10:47:11.416Z (about 1 month ago)
- Topics: container, github-action, github-actions, sqlcheck, static-analysis
- Language: Shell
- Homepage: https://github.com/marketplace/actions/sqlcheck-action
- Size: 120 KB
- Stars: 24
- Watchers: 3
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-actions - Run sqlcheck on the PR to identifies anti-patterns in SQL queries
- fucking-awesome-actions - Run sqlcheck on the PR to identifies anti-patterns in SQL queries
- awesome-workflows - Run sqlcheck on the PR to identifies anti-patterns in SQL queries
README
# action-sqlcheck
GitHub Actions that automatically identifies anti-patterns in SQL queries using [sqlcheck](https://github.com/jarulraj/sqlcheck) when PR is requested and comment on the PR if risks are found in the queries
![](assets/action-sqlcheck-pr-comment.png)
## Usage
Supports `pull_request` event type.
### Inputs
|Parameter|Required|Default Value|Description|
|:--:|:--:|:--:|:--|
|`post-comment`|false|true|Post comment to PR if it's true|
|`token`|true|""|GitHub Token in order to add comment to PR|
|`risk-level`|false|3|Set of SQL anti-patterns to check: 1,2, or 3
- 1 (all anti-patterns, default)
- 2 (only medium and high risk anti-patterns)
- 3 (only high risk anti-patterns) |
|`verbose`|false|false|Add verbose warnings to SQLCheck analysis result|
|`postfixes`|false|"sql"| List of file postfix to match. Supported separators are comma (deprecating) and retrun in multi-line string |
|`directories`|false|""| Path(s) of directory under which the action check any files whether they are part of the repository or not. By default, the action checks only files in PR queries. By specifying directories the action no longer check files in PR queries but files under the directories (maxdepth 3). Supported separator is return in multi-line string |### Outputs
|Parameter|Description|
|:--:|:--:|
|`issue-found`| A boolean value to indicate an issue was found in the files that sqlcheck action checked |## Sample Workflow
### Sample1
> .github/workflows/test1.yml
```yaml
name: sqlcheck workflow1
on: pull_requestjobs:
sqlcheck:
name: sqlcheck job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: yokawasa/[email protected]
with:
post-comment: true
risk-level: 3
verbose: false
token: ${{ secrets.GITHUB_TOKEN }}
```### Sample2 ( postfixes and directories inputs )
> .github/workflows/test2.yml
```yaml
name: sqlcheck workflow2
on: pull_requestjobs:
sqlcheck:
name: sqlcheck job
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: yokawasa/[email protected]
id: sqlcheck
with:
post-comment: true
risk-level: 3
verbose: true
token: ${{ secrets.GITHUB_TOKEN }}
postfixes: |
sql
sqlx
schema
directories: |
sql
build/sql_dir
tests/sql_dir
- name: Get output
run: echo "Issues found in previous step"
if: steps.sqlcheck.outputs.issue-found
```