Skip to content

Commit a93a5f5

Browse files
authored
Adjust python-stylecheck to skip deleted files and non-py files
Adjust the `CHANGED_FILES` lookup to exclude deleted files as they can't really be checked, and tighten match to files specifically ending with `.py` instead of all files with `py` in them (including this workflow action). Signed-off-by: Jonas Bardino <bardino@science.ku.dk>
1 parent 8f3bbc4 commit a93a5f5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/python-stylecheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fetch-depth: 0 # This is necessary to get the commits
2222
- name: Get changed python files between base and head
2323
run: >
24-
echo "CHANGED_FILES=$(echo $(git diff --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- | grep \.py))" >> $GITHUB_ENV
24+
echo "CHANGED_FILES=$(echo $(git diff --diff-filter=ACMRTB --name-only ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} -- | grep -E '\.py$'))" >> $GITHUB_ENV
2525
- if: ${{ env.CHANGED_FILES }}
2626
uses: marian-code/python-lint-annotate@v4
2727
with:

0 commit comments

Comments
 (0)