Skip to content

Commit ba0f2b9

Browse files
authored
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.
1 parent bf201c8 commit ba0f2b9

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/mypy_primer_comment.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,15 @@ jobs:
8989
9090
console.log("Diff from mypy_primer:")
9191
console.log(data)
92+
let body;
9293
if (data.trim()) {
93-
await github.issues.createComment({
94-
issue_number: context.issue.number,
95-
owner: context.repo.owner,
96-
repo: context.repo.repo,
97-
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 + '```'
98-
})
94+
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 + '```'
95+
} else {
96+
body = 'According to [mypy_primer](https://github.com/hauntsaninja/mypy_primer), this change has no effect on the checked open source code. 🤖🎉'
9997
}
98+
await github.issues.createComment({
99+
issue_number: context.issue.number,
100+
owner: context.repo.owner,
101+
repo: context.repo.repo,
102+
body,
103+
})

0 commit comments

Comments
 (0)