diff --git a/.github/scripts/parse_pylint.py b/.github/scripts/parse_pylint.py index da93d42e..15139b3c 100644 --- a/.github/scripts/parse_pylint.py +++ b/.github/scripts/parse_pylint.py @@ -1,8 +1,9 @@ import sys -def main(lines): - lines = lines.split("\n") +def main(file): + with open(file, "r", encoding="utf-8") as f: + lines = f.readlines() summary = [line for line in lines if line.startswith( "Your code has been rated at")][0] diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml index 1ffbcb05..a174a8e5 100644 --- a/.github/workflows/pylint.yml +++ b/.github/workflows/pylint.yml @@ -34,8 +34,8 @@ jobs: - name: Lint with pylint shell: bash run: | - OUTPUT=$(pylint PQAnalysis --exit-zero) - python .github/scripts/parse_pylint.py $OUTPUT | tee comment.txt + pylint PQAnalysis --exit-zero) | tee pylint_output.txt + python .github/scripts/parse_pylint.py pylint_output.txt | tee comment.txt - uses: marocchino/sticky-pull-request-comment@v2 if: (success() || failure()) && github.event.pull_request