Skip to content

Commit

Permalink
fix: slice logging count not fairly representing the actual annotatio…
Browse files Browse the repository at this point in the history
…n collection slices
  • Loading branch information
Codex- committed Oct 31, 2023
1 parent e3e8fb9 commit cbe5de1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions dist/index.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/tasks/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ export async function updateCheckAnnotations(

let i = 0;
while (i < minimalAnnotations.length) {
core.debug(`[updateCheckAnnotations]: Slicing ${i}...${i + CHECK_ANNOTATIONS_UPDATE_LIMIT}`);
core.debug(
`[updateCheckAnnotations]: Slicing ${i}...${i + (CHECK_ANNOTATIONS_UPDATE_LIMIT - 1)}`,
);

const slice = minimalAnnotations
.slice(i, i + CHECK_ANNOTATIONS_UPDATE_LIMIT)
Expand Down
2 changes: 1 addition & 1 deletion src/tasks/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ async function createOrUpdateComments(
): Promise<number[]> {
let existingIdsIndex = 0;
for (const comment of commentsToPost) {
if (existingCommentIds && existingCommentIds[existingIdsIndex] !== undefined) {
if (existingCommentIds?.[existingIdsIndex] !== undefined) {
const commentId = existingCommentIds[existingIdsIndex]!;
await updateComment(commentId, comment);
core.debug(`[createOrUpdateComments]: updated comment (${commentId})`);
Expand Down

0 comments on commit cbe5de1

Please sign in to comment.