Skip to content

Commit

Permalink
temporary force skip in derive
Browse files Browse the repository at this point in the history
  • Loading branch information
jill64 committed Dec 19, 2023
1 parent 613eb1f commit 275576e
Showing 1 changed file with 39 additions and 36 deletions.
75 changes: 39 additions & 36 deletions packages/action/src/ghosts/derive.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
import { Ghost } from '@/action/types/Ghost.js'

export const derive: Ghost = async ({ octokit, payload }) => {
const { owner, repo } = payload

const { data: repository } = await octokit.rest.repos.get({
owner,
repo
})

const { data: list } = await octokit.rest.pulls.list({
owner,
repo,
state: 'open',
base: repository.default_branch
})

if (!list.length) {
return {
status: 'skipped',
detail: 'No open PRs targeting the default branch were found.'
}
}

const result = list.map((pull) =>
octokit.rest.pulls.updateBranch({
owner,
repo,
pull_number: pull.number
})
)

await Promise.allSettled(result)

return {
status: 'success',
detail: `Updated ${result.length} PRs.`
}
export const derive: Ghost = async () => {

return 'skipped'

// const { owner, repo } = payload

// const { data: repository } = await octokit.rest.repos.get({
// owner,
// repo
// })

// const { data: list } = await octokit.rest.pulls.list({
// owner,
// repo,
// state: 'open',
// base: repository.default_branch
// })

// if (!list.length) {
// return {
// status: 'skipped',
// detail: 'No open PRs targeting the default branch were found.'
// }
// }

// const result = list.map((pull) =>
// octokit.rest.pulls.updateBranch({
// owner,
// repo,
// pull_number: pull.number
// })
// )

// await Promise.allSettled(result)

// return {
// status: 'success',
// detail: `Updated ${result.length} PRs.`
// }

Check warning on line 41 in packages/action/src/ghosts/derive.ts

View check run for this annotation

Codecov / codecov/patch

packages/action/src/ghosts/derive.ts#L3-L41

Added lines #L3 - L41 were not covered by tests
}

0 comments on commit 275576e

Please sign in to comment.