-
Notifications
You must be signed in to change notification settings - Fork 1
73 lines (55 loc) · 1.82 KB
/
autoformatter.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: SQL Formatting
on:
push:
branches:
- main # Adjust the branch name as needed
permissions:
contents: write
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 14
- name: Install dependencies
run: npm install sql-formatter prettier
- name: Format SQL files
run: npx sql-formatter --overwrite '**/*.sql' && npx prettier --write '**/*.sql'
# name: "Formatting queries"
# on: # rebuild any PRs and master branch changes
# pull_request:
# push:
# branches:
# - master
# permissions:
# contents: write
# jobs:
# format:
# name: Format SQL Queries
# runs-on: ubuntu-latest
# steps:
# - name: checkout repo
# uses: actions/[email protected]
# - name: Testing
# uses: erevear/snowsql-formatter-action@main
# # - name: Checkout code
# # uses: actions/checkout@v4
# # - name: Format SQL
# # uses: sqltools/formatter-action@v1
# # with:
# # path: /
# # args: --indent-type=space --indent-size=2 --keyword-case=upper
# # - name: Install zetasql
# # run: |
# # wget https://github.com/Matts966/zetasql-formatter/releases/download/v1.6.5/zetasql-formatter_linux_x86_64.zip
# # sudo unzip zetasql-formatter_linux_x86_64.zip -d /usr/local/bin
# # rm zetasql-formatter_linux_x86_64.zip
# # - name: Format SQL Queries
# # uses: yoheikikuta/[email protected]
# # with:
# # args: --indent_size=4 # customize the formatting options as needed
# # path: / # specify the path to the SQL files