Skip to content

Commit d8ae172

Browse files
authored
fix: undefined affected rows (#13)
1 parent ab6d36f commit d8ae172

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

dist/index.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/comment.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const upsertComment = async (res: CheckReleaseResponse) => {
3939
let message = `
4040
## SQL Review Summary
4141
42-
* Total Affected Rows: **${res.affectedRows}**
42+
* Total Affected Rows: **${res.affectedRows ?? 0}**
4343
* Overall Risk Level: **${stringifyRiskLevel(res.riskLevel)}**
4444
* Advices Statistics: **${totalErrorAdviceCount} Error(s), ${totalWarningAdviceCount} Warning(s)**
4545
`
@@ -85,7 +85,7 @@ export const upsertComment = async (res: CheckReleaseResponse) => {
8585
message += `<tr>
8686
<td>${result.file}</td>
8787
<td>${result.target}</td>
88-
<td>${result.affectedRows}</td>
88+
<td>${result.affectedRows ?? 0}</td>
8989
<td>${stringifyRiskLevel(result.riskLevel)}</td>
9090
<td>${advicesCell}</td>
9191
</tr>`

src/type.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ export interface CheckReleaseResponse {
1212
file: string
1313
target: string
1414
advices: any[] | undefined
15-
affectedRows: number
15+
affectedRows: number | undefined
1616
riskLevel: string
1717
}[]
1818
| undefined
19-
affectedRows: number
19+
affectedRows: number | undefined
2020
riskLevel: string
2121
}
2222

0 commit comments

Comments
 (0)