diff --git a/.github/workflows/mypy_primer.yaml b/.github/workflows/mypy_primer.yaml index 77366c5684..42333f7978 100644 --- a/.github/workflows/mypy_primer.yaml +++ b/.github/workflows/mypy_primer.yaml @@ -10,6 +10,7 @@ on: - "crates/ruff_python_ast" - "crates/ruff_python_parser" - ".github/workflows/mypy_primer.yaml" + - ".github/workflows/mypy_primer_comment.yaml" concurrency: group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} @@ -67,7 +68,7 @@ jobs: --new "$GITHUB_SHA" \ --project-selector '/(mypy_primer|black|pyp|git-revise|zipp|arrow)$' \ --output concise \ - --debug | tee mypy_primer.diff + --debug | tee /dev/stdout | sed -e 's/\x1b\[[0-9;]*m//g' > mypy_primer.diff ) || [ $? -eq 1 ] echo ${{ github.event.number }} > pr-number diff --git a/.github/workflows/mypy_primer_comment.yaml b/.github/workflows/mypy_primer_comment.yaml index 1c24ece195..f44fbfe1d1 100644 --- a/.github/workflows/mypy_primer_comment.yaml +++ b/.github/workflows/mypy_primer_comment.yaml @@ -62,9 +62,13 @@ jobs: echo '' >> comment.txt echo '## `mypy_primer` results' >> comment.txt - echo '```diff' >> comment.txt - cat pr/mypy_primer_diff/mypy_primer.diff >> comment.txt - echo '```' >> comment.txt + if [ -s "pr/mypy_primer_diff/mypy_primer.diff" ]; then + echo '```diff' >> comment.txt + cat pr/mypy_primer_diff/mypy_primer.diff >> comment.txt + echo '```' >> comment.txt + else + echo 'No ecosystem changes detected ✅' >> comment.txt + fi echo 'comment<> "$GITHUB_OUTPUT" cat comment.txt >> "$GITHUB_OUTPUT"