-
Notifications
You must be signed in to change notification settings - Fork 295
55 lines (47 loc) · 1.87 KB
/
_code-quality.yml
File metadata and controls
55 lines (47 loc) · 1.87 KB
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
# **what?**
# Runs code quality checks using pre-commit hooks.
# **why?**
# Ensure code for dbt meets a certain quality standard.
# **when?**
# This workflow runs for all PRs, when code is pushed to main branch, and when manually triggered.
name: "# Code quality"
run-name: "Code quality - ${{ github.actor }} - branch:${{ inputs.branch }} repository:${{ inputs.repository }}"
on:
workflow_call:
inputs:
branch:
description: "Choose the branch to check"
type: string
default: "main"
repository:
description: "Choose the repository to check, when using a fork"
type: string
default: "dbt-labs/dbt-adapters"
workflow_dispatch:
inputs:
branch:
description: "Choose the branch to check"
type: string
default: "main"
repository:
description: "Choose the repository to check, when using a fork"
type: string
default: "dbt-labs/dbt-adapters"
permissions:
contents: read
jobs:
code-quality:
runs-on: ${{ vars.DEFAULT_RUNNER }}
steps:
- name: "Checkout ${{ inputs.branch }}"
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # actions/checkout@v4
with:
ref: ${{ inputs.branch }}
repository: ${{ inputs.repository }}
submodules: true
- name: "Set up Python"
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # actions/setup-python@v5
with:
python-version: ${{ vars.DEFAULT_PYTHON_VERSION }}
- name: "Run pre-commit hooks"
uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # pre-commit/action@v3.0.1