-
Notifications
You must be signed in to change notification settings - Fork 10
46 lines (39 loc) · 1.17 KB
/
auto-format.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
name: Auto format
on:
push:
branches:
- master
- release
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
auto_format:
name: Auto format with ruff
runs-on: arc-runners-small
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
- name: Get Python version
id: python_version
run: echo "python_version=$(head -n 1 .python-version)" >> $GITHUB_OUTPUT
shell: bash
- uses: ./.github/workflows/actions/prepare
with:
python-version: ${{ steps.python_version.outputs.python_version }}
- name: Check files using the ruff formatter
run: |
poetry run ruff check --fix --unsafe-fixes --preview --exit-zero .
poetry run ruff format .
shell: bash
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
fetch: false
default_author: github_actions
message: 'Backend: Auto format'
add: '.'