Skip to content

Commit

Permalink
Maybe add status check
Browse files Browse the repository at this point in the history
  • Loading branch information
rehlma committed Apr 9, 2024
1 parent 4f793a1 commit 359eb09
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export async function run(): Promise<void> {
} else {
const comment = generateComment(newTodos, removedTodos)

await commentPr(octokit, comment)
await commentPr(octokit, comment, headRef)
core.setOutput('comment', comment)
}
} catch (error) {
Expand Down Expand Up @@ -104,7 +104,8 @@ function generateComment(newTodos: string[], removedTodos: string[]): string {

async function commentPr(
octokit: ReturnType<typeof github.getOctokit>,
comment: string
comment: string,
head: string,

Check failure on line 108 in src/main.ts

View workflow job for this annotation

GitHub Actions / Lint Codebase

Delete `,`
): Promise<void> {
const { owner, repo } = github.context.repo
const issueNumber = github.context.payload.pull_request?.number
Expand Down Expand Up @@ -143,4 +144,11 @@ async function commentPr(
body: comment
})
}

await octokit.rest.repos.addStatusCheckContexts({
owner,
repo,
branch: head,
contexts: ['todo-check']
})
}

0 comments on commit 359eb09

Please sign in to comment.