forked from tschm/cradle
-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (35 loc) · 1.12 KB
/
pre-commit.yml
File metadata and controls
42 lines (35 loc) · 1.12 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
# This file is part of the tschm/.config-templates repository
# (https://github.com/tschm/.config-templates).
#
# Workflow: Pre-commit
#
# Purpose: This workflow runs pre-commit checks to ensure code quality
# and consistency across the codebase. It helps catch issues
# like formatting errors, linting issues, and other code quality
# problems before they are merged.
#
# Trigger: This workflow runs on every push and on pull requests to main/master
# branches (including from forks)
#
# Components:
# - 🔍 Run pre-commit checks using reusable action
name: "PRE-COMMIT"
permissions:
contents: read
on:
push:
pull_request:
branches: [ main, master ]
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Get Python version
id: get-python
run: |
echo "python-version=$(python ./.github/workflows/scripts/version_max.py)" >> "$GITHUB_OUTPUT"
- uses: ./.github/actions/setup-project
with:
python-version: ${{ steps.get-python.outputs.python-version }}
- uses: pre-commit/action@v3.0.1