Skip to content

Commit 59f47ee

Browse files
authored
six summary table, small cleanup, bump deps (#101)
1 parent c754314 commit 59f47ee

File tree

5 files changed

+305
-308
lines changed

5 files changed

+305
-308
lines changed

dist/index.js

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
"@actions/github": "^9.0.0",
1818
"js-base64": "^3.7.8",
1919
"markdown-table": "^3.0.4",
20-
"semver": "^7.7.3"
20+
"semver": "^7.7.4"
2121
},
2222
"devDependencies": {
2323
"@types/node": "24.1.0",
2424
"@types/semver": "^7.7.1",
2525
"@yarnpkg/lockfile": "^1.1.0",
2626
"@yarnpkg/parsers": "^3.0.3",
27-
"esbuild": "^0.27.2",
28-
"oxfmt": "^0.27.0",
29-
"oxlint": "^1.42.0",
27+
"esbuild": "^0.27.3",
28+
"oxfmt": "^0.28.0",
29+
"oxlint": "^1.43.0",
3030
"oxlint-tsgolint": "^0.11.4",
3131
"tsx": "^4.21.0",
3232
"typescript": "^5.9.3"

src/action.ts

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -136,20 +136,12 @@ async function run() {
136136
'\n\n' +
137137
'</details>';
138138

139-
if (updateComment) {
140-
if (commentId) {
141-
await octokit.rest.issues.updateComment({
142-
...oktokitParams,
143-
comment_id: commentId,
144-
body,
145-
});
146-
} else {
147-
await octokit.rest.issues.createComment({
148-
...oktokitParams,
149-
issue_number: number,
150-
body,
151-
});
152-
}
139+
if (updateComment && commentId) {
140+
await octokit.rest.issues.updateComment({
141+
...oktokitParams,
142+
comment_id: commentId,
143+
body,
144+
});
153145
} else {
154146
await octokit.rest.issues.createComment({
155147
...oktokitParams,

src/comment.ts

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,17 @@ export function createTable(lockChanges: Record<string, LockChanges>, groupByTyp
4444

4545
function createSummaryRow(lockChanges: Record<string, LockChanges>, status: keyof typeof ASSETS_URL) {
4646
const statusCount = countStatuses(lockChanges, status);
47-
return statusCount ? [getStatusLabel(status), statusCount.toString()] : [undefined];
47+
return statusCount ? [getStatusLabel(status), statusCount.toString()] : [];
4848
}
4949

5050
export function createSummary(lockChanges: Record<string, LockChanges>) {
51-
return markdownTable([['Status', 'Count'], ...STATUS_ORDER.map(status => createSummaryRow(lockChanges, status))], {
52-
align: ['l', 'c'],
53-
alignDelimiters: false,
54-
});
51+
return markdownTable(
52+
[['Status', 'Count'], ...STATUS_ORDER.map(status => createSummaryRow(lockChanges, status))].filter(
53+
row => row.length
54+
),
55+
{
56+
align: ['l', 'c'],
57+
alignDelimiters: false,
58+
}
59+
);
5560
}

0 commit comments

Comments
 (0)