Skip to content

Commit 48dc990

Browse files
authored
Sync mypy_primer_comment with typeshed (#12125)
1 parent 26fdd45 commit 48dc990

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/mypy_primer_comment.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,17 @@ jobs:
8585
console.log("Diff from mypy_primer:")
8686
console.log(data)
8787
88+
let body
8889
if (data.trim()) {
89-
const 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 + '```'
90-
await github.issues.createComment({
91-
issue_number: fs.readFileSync("pr_number.txt", { encoding: "utf8" }),
92-
owner: context.repo.owner,
93-
repo: context.repo.repo,
94-
body
95-
})
90+
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 + '```'
91+
} else {
92+
body = 'According to [mypy_primer](https://github.com/hauntsaninja/mypy_primer), this change has no effect on the checked open source code. 🤖🎉'
9693
}
94+
const prNumber = parseInt(fs.readFileSync("pr_number.txt", { encoding: "utf8" }))
95+
await github.issues.createComment({
96+
issue_number: prNumber,
97+
owner: context.repo.owner,
98+
repo: context.repo.repo,
99+
body
100+
})
101+
return prNumber

0 commit comments

Comments
 (0)