import report from "./report" ; import { GithubAPI , Repository } from "./types" ; export default async function run ( github , repo , sha , deps ) { await report ( github , repo , sha , "pending" , [ ] ) ; let pass = true ; let blockers = [ ] ; deps = Array . from ( new Set ( deps ) ) ; for ( const issue_number of deps ) { const issue = await github . issues . get ( { ... repo , issue_number } ) ; if ( issue . data . state === "open" ) { pass = false ; blockers . push ( issue_number ) ; } } return report ( github , repo , sha , pass ? "success" : "failure" , blockers ) ; }