Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/credfeto/action-sql-format


https://github.com/credfeto/action-sql-format

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# Reformat SQL Files

## How to use it?
This is a GitHub action, so it has to be added to a GitHub workflow.

A simple example of running this action on all pushes to the repository would be to
add a `reformatsql.yml` file under `.github/workflows` with the following content

```yaml
on: [push]

jobs:
reformat-sql:
runs-on: ubuntu-latest
steps:
# Checkout the source code there are have some files to look at.
- uses: actions/[email protected]
with:
fetch-depth: 0
token: ${{secrets.SOURCE_PUSH_TOKEN}}

# Run the reformat action
- name: Reformat SQL Files
uses: credfeto/[email protected]

# Commit any changes to the repo
- uses: stefanzweifel/[email protected]
with:
commit_message: "[Reformat] SQL Files to common format"
file_pattern: "*.sql"
commit_user_name: "sqlfmt[bot]"
commit_user_email: "[email protected]"
commit_author: "sqlfmt[bot] "
skip_dirty_check: false
```

On each push, it will reformat the SQL. Note you'll need to commit and push any commits back to your GithHub repo.

## Contributors