-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathaction.yml
74 lines (73 loc) · 2.17 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
name: 'Flake8 with annotations'
author: 'Patric "TrueBrain" Stout'
description: 'Flake8 with annotations for Pull Request'
inputs:
path:
description: 'Path to run flake8 in'
required: false
default: ''
ignore:
description: 'Skip errors and warnings (e.g. E4,W)'
required: false
default: ''
max_line_length:
description: 'Set maximum allowed line length'
required: false
default: ''
only_warn:
description: 'If set, only warn, never error'
required: false
default: ''
flake8_version:
description: 'What flake8 version to use, if none is installed (default is latest)'
required: false
default: ''
plugins:
description: 'List of plugins to install before running, this is passed directly to pip install'
required: false
default: ''
error_classes:
description: 'List of flake8 error classes to classify as Error'
required: false
default: 'E,F'
warning_classes:
description: 'List of flake8 error classes to classify as Warning'
required: false
default: ''
extra_arguments:
description: 'Extra arguments given to flake8'
required: false
default: ''
working_directory:
description: 'Working directory to run flake8 in'
required: false
default: '.'
runs:
using: 'composite'
steps:
- run: |
if [ -z "${{ inputs.flake8_version }}" ]; then
flake8_version=""
else
flake8_version="==${{ inputs.flake8_version }}"
fi
plugins=
if [ -n "${{ inputs.plugins }}" ]; then
plugins="${{ inputs.plugins }}"
fi
PIP_BREAK_SYSTEM_PACKAGES=1 pip install flake8${flake8_version} ${plugins}
shell: bash
- run: ${{ github.action_path }}/action/entrypoint.sh
shell: bash
working-directory: ${{ inputs.working_directory }}
env:
INPUT_PATH: ${{ inputs.path }}
INPUT_IGNORE: ${{ inputs.ignore }}
INPUT_MAX_LINE_LENGTH: ${{ inputs.max_line_length }}
INPUT_ONLY_WARN: ${{ inputs.only_warn }}
INPUT_ERROR_CLASSES: ${{ inputs.error_classes }}
INPUT_WARNING_CLASSES: ${{ inputs.warning_classes }}
INPUT_EXTRA_ARGUMENTS: ${{ inputs.extra_arguments }}
branding:
icon: 'code'
color: 'blue'