Skip to content

Commit

Permalink
Resolved linting deleted file error from workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
bakhtawar-10xe committed Sep 4, 2023
1 parent e5f267f commit 64ef7e7
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/linting_modified_files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@ jobs:
run: |
changed_files=$(git diff --name-only origin/main..HEAD | grep ".py$")
if [ "$changed_files" ]; then
echo "Running pylint on changed files:"
echo "$changed_files"
echo "$changed_files" | xargs pylint
changed_files=$(git diff --name-only origin/main..HEAD | grep ".py$")
for file in $changed_files; do
if [ -e "$file" ]; then
echo "Linting $file"
pylint "$file"
else
echo "Skipping lint for deleted file: $file"
fi
done
else
echo "No Python files have been changed."
fi

0 comments on commit 64ef7e7

Please sign in to comment.