-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
47 lines (47 loc) · 1.46 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
name: "ruff-action"
description: "A GitHub Action to run Ruff, an extremely fast Python linter and code formatter."
author: "astral-sh"
inputs:
args:
description: "Arguments passed to Ruff. Use `ruff --help` to see available options. Defaults to `check`."
required: false
default: "check"
src:
description: "Source to run Ruff. Defaults to the current directory."
required: false
default: "."
version:
description: 'The version of Ruff to use, e.g., `0.6.0` Defaults to the latest version.'
required: false
default: ""
changed-files:
description: 'Whether to only run Ruff on changed files. Defaults to `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@v45
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 }}
IS_CHANGED_FILES_ENABLED: ${{ inputs.changed-files }}
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
pythonioencoding: utf-8
shell: bash