-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
50 lines (46 loc) · 1.66 KB
/
action.yml
File metadata and controls
50 lines (46 loc) · 1.66 KB
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
name: "Python Code Style Action"
description: "This action helps python code to adhere to the celebrate coding standards."
inputs:
fail_on_error:
description: "Should the action fail if errors are found? [default: true]"
required: false
default: "true"
runs:
using: "composite"
steps:
- name: Check reporter type
id: reporter-check
shell: bash
run: |
if [ ${{ github.event_name }} = "pull_request" ]; then
echo "reporter=github-pr-review" >> $GITHUB_OUTPUT
else
echo "reporter=github-check" >> $GITHUB_OUTPUT
fi
- name: Detect changed files
uses: dorny/paths-filter@v2.11.1
id: changes
with:
filters: |
addedOrModifiedPython:
- added|modified: '**/*.py'
list-files: shell
- name: flake8
if: steps.changes.outputs.addedOrModifiedPython == 'true'
uses: reviewdog/action-flake8@v3
with:
flake8_args: ${{ steps.changes.outputs.addedOrModifiedPython_files }}
reporter: ${{ steps.reporter-check.outputs.reporter }}
- name: mypy
if: steps.changes.outputs.addedOrModifiedPython == 'true'
uses: tsuyoshicho/action-mypy@v3.13.0
with:
target: ${{ steps.changes.outputs.addedOrModifiedPython_files }}
reporter: ${{ steps.reporter-check.outputs.reporter }}
- name: pylint
if: steps.changes.outputs.addedOrModifiedPython == 'true'
uses: dciborow/action-pylint@0.1.0
with:
glob_pattern: ${{ steps.changes.outputs.addedOrModifiedPython_files }}
reporter: ${{ steps.reporter-check.outputs.reporter }}
fail_on_error: ${{ inputs.fail_on_error }}