-
Notifications
You must be signed in to change notification settings - Fork 14
/
action.yml
92 lines (83 loc) · 2.57 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: python-isort
author: jamescurtin
description: Run isort on a Python project
branding:
icon: check
color: blue
inputs:
isort-version:
description: Version of isort to use
required: false
# Use default null to fallback to isortVersion with the expression:
#
# ${{ inputs.isort-version || inputs.isortVersion }}
#
# TODO: Change to latest when dropping support for isortVersion.
default: null
isortVersion:
description: >
Version of isort to use (DEPRECATED: use isort-version instead)
required: false
default: latest
sort-paths:
description: files or directories to sort
required: false
# Use default null to fallback to sortPaths with the expression:
#
# ${{ inputs.sort-paths || inputs.sortPaths }}
#
# TODO: Change to . when dropping support for sortPaths.
default: null
sortPaths:
description: >
files or directories to sort (DEPRECATED: use sort-paths instead)
required: false
default: .
configuration:
description: isort configuration options
required: false
default: --check-only --diff
requirements-files:
description: >
path(s) to requirements files that should be installed to properly
configure third-party imports
required: false
# Use default null to fallback to requirementsFiles with the expression:
#
# ${{ inputs.requirements-files || inputs.requirementsFiles }}
#
# TODO: Change to "" when dropping support for requirementsFiles.
default: null
requirementsFiles:
description: >
path(s) to requirements files that should be installed to properly
configure third-party imports (DEPRECATED: use requirement-files instead)
required: false
default: ""
outputs:
isort-result:
description: isort result
value: ${{ steps.run-isort.outputs.isort-output }}
runs:
using: composite
steps:
- run: $GITHUB_ACTION_PATH/bin/ensure_python
shell: bash
- run: >
python -m venv "${HOME}/isort-venv"
shell: bash
- run: >
$GITHUB_ACTION_PATH/bin/install_packages
${{ inputs.isort-version || inputs.isortVersion }}
${{ inputs.requirements-files || inputs.requirementsFiles }}
shell: bash
- run: echo "::add-matcher::$GITHUB_ACTION_PATH/isort-matcher.json"
shell: bash
- id: run-isort
run: >
$GITHUB_ACTION_PATH/bin/run_isort
${{ inputs.configuration }}
${{ inputs.sort-paths || inputs.sortPaths }}
shell: bash
- run: echo "::remove-matcher owner=isort-matcher::"
shell: bash