Skip to content

Commit

Permalink
GitHub: run unused imports action only for pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
c-po committed Apr 3, 2024
1 parent d4b53a3 commit 9de7a30
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/unused-imports.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Pylint

on: [push]
on:
pull_request_target:
types: [opened, reopened, ready_for_review, locked]

jobs:
build:
Expand All @@ -20,4 +21,9 @@ jobs:
pip install pylint
- name: Analysing the code with pylint
run: |
make unused-imports
tmp=$(git ls-files *.py | xargs pylint | grep W0611 | wc -l)
if [[ $tmp -gt 0 ]]; then
echo "Found $tmp occurrence of unused Python import statements!"
exit 1
fi
exit 0

0 comments on commit 9de7a30

Please sign in to comment.