-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (44 loc) · 1.27 KB
/
Copy pathruff.yml
File metadata and controls
53 lines (44 loc) · 1.27 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
# This workflow runs the Ruff linter
name: Ruff
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
permissions:
contents: write
id-token: write
issues: write
pull-requests: write
jobs:
ruff:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
cache-dependency-glob: "uv.lock"
enable-cache: true
- name: Install library and dependencies
run: uv sync --frozen
- name: Lint with Ruff
id: lint
run: |
uv run --frozen ruff check --fix .
echo "RUFF_SUCCESS=$([ $? -eq 0 ])" >> $GITHUB_OUTPUT
- name: Create Pull Request
uses: peter-evans/create-pull-request@v8
if: ${{ !steps.lint.outputs.RUFF_SUCCESS }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
title: "Format Python code with Ruff push"
commit-message: "[PATCH] Ruff auto-format"
body: |
There appear to be some python formatting errors in ${{ github.sha }}.
This pull request uses the Ruff formatter to fix some of these issues.
base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch
branch: actions/ruff