generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
63 lines (55 loc) · 1.69 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
name: 'Pylint Annotation Action'
description: 'Lint code with Pylint and annotate it in the pull request'
author: 'Piotr Karpala'
inputs:
python-version:
description: 'Python version to use'
required: true
default: '3.11'
outputs:
result:
description: "Result of the lint action"
value: ${{ steps.pylint-annotation.outputs.result }}
runs:
using: "composite"
steps:
- name: List Changed Files
id: changed_files
uses: karpikpl/sample-action@main
with:
file-filter: '*.py'
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python-version }}
- name: Update pip
shell: bash
run: |
pip install --upgrade pip
pip install pylint
- name: Run Pylint
continue-on-error: true
id: pylint
shell: bash
run: |
{ pylint ${{ steps.changed_files.outputs.changed_files || '**/*.py' }} --output-format=json2:pylint.json,colorized,text:pylint.txt; TASK_EXIT_CODE=$?; } || true
{
echo "## Pylint"
echo "<details><summary>Click to expand</summary>"
echo ""
echo '```'
cat pylint.txt
echo '```'
echo "</details>"
} >> $GITHUB_STEP_SUMMARY
echo "exitcode=$TASK_EXIT_CODE" >> $GITHUB_OUTPUT
- name: Annotate Commit with Pylint Results
uses: karpikpl/pylint-annotation-action@v1.0.1
id: pylint-annotation
with:
head-sha: ${{ steps.changed_files.outputs.head_sha || github.sha }}
lint-file: pylint.json
pylint-result-code: ${{ steps.pylint.outputs.exitcode }}
branding:
icon: 'git-pull-request'
color: 'purple'