Skip to content

Commit 768faee

Browse files
authored
Fix pylint.yml
1 parent a66702d commit 768faee

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

.github/workflows/pylint.yml

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
name: Pylint
22

3-
on: [push]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
48

59
jobs:
610
build:
@@ -9,15 +13,25 @@ jobs:
913
matrix:
1014
python-version: ["3.8", "3.9", "3.10"]
1115
steps:
12-
- uses: actions/checkout@v4
13-
- name: Set up Python ${{ matrix.python-version }}
14-
uses: actions/setup-python@v3
15-
with:
16-
python-version: ${{ matrix.python-version }}
17-
- name: Install dependencies
18-
run: |
19-
python -m pip install --upgrade pip
20-
pip install pylint
21-
- name: Analysing the code with pylint
22-
run: |
23-
pylint $(git ls-files '*.py')
16+
- name: Checkout repository
17+
uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
28+
pip install pylint
29+
30+
- name: Analysing the code with pylint
31+
run: |
32+
FILES=$(git ls-files '*.py')
33+
if [ -n "$FILES" ]; then
34+
pylint $FILES
35+
else
36+
echo "No Python files to lint."
37+
fi

0 commit comments

Comments
 (0)