forked from ChartBoost/ruff-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
48 lines (48 loc) · 1.34 KB
/
action.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
47
48
name: "Ruff GH Action"
description: "A GH Action of Ruff, the extremely fast Python linter."
author: "The Ruff Community"
inputs:
args:
description:
"Arguments passed to Ruff. Use `ruff --help` to see available options.
Default: 'check'"
required: false
default: "check"
src:
description: "Source to run ruff. Default: '.'"
required: false
default: "."
version:
description: 'The version of ruff to use, e.g. "0.0.259"'
required: false
default: ""
changed-files:
description: 'Whether to only run ruff on changed files. Default: false'
required: false
default: "false"
branding:
color: "black"
icon: "code"
runs:
using: composite
steps:
- name: Get changed files
id: changed-files
if: ${{ inputs.changed-files == 'true' }}
uses: tj-actions/changed-files@v44
with:
files: '**.py'
- run: |
if [ "$RUNNER_OS" == "Windows" ]; then
python $GITHUB_ACTION_PATH/action/main.py
else
python3 $GITHUB_ACTION_PATH/action/main.py
fi
env:
RUFF_OUTPUT_FORMAT: github
INPUT_ARGS: ${{ inputs.args }}
INPUT_SRC: ${{ inputs.src }}
INPUT_VERSION: ${{ inputs.version }}
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
pythonioencoding: utf-8
shell: bash