mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Only add a mypy_primer comment if there is output (#4725)
This commit is contained in:
14
.github/workflows/mypy_primer.yml
vendored
14
.github/workflows/mypy_primer.yml
vendored
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user