Skip to content

Commit

Permalink
- update all check results in a loop by 50 elements
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz committed Nov 21, 2021
1 parent 8f57b37 commit 1fbc0d3
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
19 changes: 11 additions & 8 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

26 changes: 15 additions & 11 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,24 @@ export async function run(): Promise<void> {

const check_run_id = checks.data.check_runs[0].id

const updateCheckRequest = {
...github.context.repo,
check_run_id,
output: {
title,
summary,
conclusion,
annotations: testResult.annotations.slice(0, 50)
for (let i = 0; i < testResult.annotations.length; i = i + 50) {
const sliced = testResult.annotations.slice(i, i + 50)

const updateCheckRequest = {
...github.context.repo,
check_run_id,
output: {
title,
summary,
conclusion,
annotations: sliced
}
}
}

core.debug(JSON.stringify(updateCheckRequest, null, 2))
core.debug(JSON.stringify(updateCheckRequest, null, 2))

await octokit.rest.checks.update(updateCheckRequest)
await octokit.rest.checks.update(updateCheckRequest)
}
} else {
const createCheckRequest = {
...github.context.repo,
Expand Down

0 comments on commit 1fbc0d3

Please sign in to comment.