Always generate a comment for mypy_primer (#5197)

This way, runs without output after runs with output can be clearly
determined. This also makes it easier to recognize when a run was not
completed.
This commit is contained in:
Sebastian Rittau
2021-04-15 09:18:13 +02:00
committed by GitHub
parent bf201c8201
commit ba0f2b929b

View File

@@ -89,11 +89,15 @@ jobs:
console.log("Diff from mypy_primer:")
console.log(data)
let body;
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 + '```'
})
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 + '```'
} else {
body = 'According to [mypy_primer](https://github.com/hauntsaninja/mypy_primer), this change has no effect on the checked open source code. 🤖🎉'
}
await github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body,
})