-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.39 KB
/
reformat-sql.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
--- # Reformatting MSSQL
name: "Standardise: MSSQL Format"
on:
push:
branches-ignore:
- "release/*"
- "hotfix/*"
paths:
- '**.sql'
- '.github/workflows/reformat-sql.yml'
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true
permissions:
contents: write
jobs:
standardise-tsql-files:
if: |-
github.event.pull_request.draft == false
&& ( !startsWith(github.head_ref, 'release/')
&& !startsWith(github.head_ref, 'hotfix/') )
&& github.actor != 'dependabot[bot]'
runs-on: [self-hosted, linux]
steps:
- name: "Initialise Workspace"
shell: bash
run: sudo chown -R "$USER:$USER" "$GITHUB_WORKSPACE"
- name: "Checkout Source"
uses: actions/[email protected]
with:
fetch-depth: 0
fetch-tags: true
token: ${{secrets.SOURCE_PUSH_TOKEN}}
- name: "Reformat"
uses: credfeto/[email protected]
- name: "Commit Changes"
uses: stefanzweifel/[email protected]
with:
commit_message: "[Reformat] SQL Files to common format"
file_pattern: "*.sql"
commit_user_name: "fun-sqlfmt[bot]"
commit_user_email: "[email protected]"
commit_author: "fun-sqlfmt[bot] <[email protected]>"
skip_dirty_check: false