Skip to content

Commit

Permalink
iterate
Browse files Browse the repository at this point in the history
  • Loading branch information
jean9696 committed Dec 26, 2023
1 parent cce413b commit fc4f630
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions dist/index.js

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

8 changes: 5 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ export async function run(): Promise<void> {
const pullRequests = await octokit.rest.pulls.list({
...github.context.repo,
base: latestRelease.data.target_commitish,
head: mainBranch
head: mainBranch,
state: 'closed'
})
console.log(`${pullRequests} found`)
console.log(`${pullRequests.data.length} found`)

const linearTickets = await Promise.all(
pullRequests.data
Expand All @@ -27,9 +28,10 @@ export async function run(): Promise<void> {
issue_number: pr.number
})
const linearComment = comments.data.find(c => {
core.debug(`Comment by ${c.performed_via_github_app}`)
console.log(`Comment by ${c.performed_via_github_app}`)
return c.performed_via_github_app?.name === 'linear'
})
console.log(JSON.stringify(linearComment?.body))
const ticket = linearComment?.body?.match(/\bRAY-\d+\b/)
return ticket?.[0].match // eslint-disable-line @typescript-eslint/unbound-method
})
Expand Down

0 comments on commit fc4f630

Please sign in to comment.