diff --git a/.github/workflows/mypy_primer.yml b/.github/workflows/mypy_primer.yml index ece6e9f24..72ec3efd0 100644 --- a/.github/workflows/mypy_primer.yml +++ b/.github/workflows/mypy_primer.yml @@ -45,12 +45,14 @@ jobs: const fs = require('fs').promises; try { data = await fs.readFile('diff.txt', 'utf-8') - await github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: 'Diff from [mypy_primer](https://github.com/hauntsaninja/mypy_primer), showing the effect of this PR on open source code:\n```diff\n' + data + '```' - }) + if (data.trim()) { + await github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: 'Diff from [mypy_primer](https://github.com/hauntsaninja/mypy_primer), showing the effect of this PR on open source code:\n```diff\n' + data + '```' + }) + } } catch (error) { console.log(error) }