forked from NeuralEnsemble/elephant
-
Notifications
You must be signed in to change notification settings - Fork 9
38 lines (32 loc) · 966 Bytes
/
ruff-formatting.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
name: Ruff formatting
on:
workflow_dispatch:
schedule:
- cron: "0 12 * * 0" # Weekly at noon UTC on Sundays
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check with Ruff
id: ruff-check
uses: chartboost/ruff-action@v1
with:
src: './elephant'
args: 'format --check'
continue-on-error: true
- name: Fix with Ruff
uses: chartboost/ruff-action@v1
if : ${{ steps.ruff-check.outcome == 'failure' }}
with:
src: './elephant'
args: 'format --verbose'
- name: Create PR
uses: peter-evans/create-pull-request@v5
if : ${{ steps.ruff-check.outcome == 'failure' }}
with:
commit-message: ruff formatting
title: Ruff formatting
body: Reformatting code with ruff
branch: ruff-formatting