-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (49 loc) · 1.48 KB
/
linting.yml
File metadata and controls
59 lines (49 loc) · 1.48 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
56
57
58
59
name: Linting
on:
workflow_call:
inputs:
ref:
required: true
type: string
commit_changes:
required: false
type: boolean
default: false
defaults:
run:
working-directory: ./
permissions:
contents: read
jobs:
lint-format:
permissions:
contents: write
runs-on: ubuntu-latest
name: Reformat Code
steps:
- name: Harden runner
uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0
with:
egress-policy: audit
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ inputs.ref }}
- name: Setup uv
uses: astral-sh/setup-uv@v4
with:
python-version: "3.10"
- name: Install dependencies
run: uv sync --group dev --frozen
- name: Run Formatter
run: uv run ruff format .
- name: Commit Changes
if: ${{ inputs.commit_changes == true }}
uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 # v5.2.0
with:
commit_message: 'style: Apply automated code formatting [skip ci]'
commit_options: '--no-verify'
repository: .
commit_user_name: github-actions[bot]
commit_user_email: github-actions[bot]@users.noreply.github.com
commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>