-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathaction.yml
33 lines (33 loc) · 1.39 KB
/
action.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
name: 'SQL Review'
description: 'Parse and check the SQL statement according to the SQL review rules'
inputs:
override-file-path:
description: 'SQL check configuration override file path. Required if the template is not specified.'
required: false
default: ""
database-type:
description: 'The database type. Please check https://github.com/bytebase/sql-review-action/blob/main/README.md#about-parameters for support database engines.'
required: true
template-id:
description: 'The SQL check template id, required if the "override-file-path" is not specified. Should be one of "bb.sql-review.prod", "bb.sql-review.dev".'
required: false
file-pattern:
description: 'The file path pattern for your SQL files. Defaults "^.*\.sql$"'
required: false
default: '^.*\.sql$'
runs:
using: "composite"
steps:
- name: Get changed files
id: changed-files
uses: umani/[email protected]
with:
repo-token: ${{ github.token }}
pattern: "${{ inputs.file-pattern }}"
- name: SQL Review
run: |
$GITHUB_ACTION_PATH/main.sh --files="${{ steps.changed-files.outputs.files_created }} ${{ steps.changed-files.outputs.files_updated }}" --database-type=${{ inputs.database-type }} --override-file="${{ inputs.override-file-path }}" --template-id="${{ inputs.template-id }}"
shell: bash
branding:
icon: "database"
color: "gray-dark"