import { GET } from "./request" ; import type { ITpl } from '@/tpl' ; import { loggerError } from "@/util" ; export interface IBranch { name : string ; commit : { sha : string ; url : string ; } ; protected : boolean ; } description param { ITpl } params return { * } export const getGithubBranch = async ( params ) => { try { const { apiUrl , org } = params ; const url = `${ apiUrl }/repos/${ org }/branches` ; const res = await GET < IBranch [ ] > ( { url } ) ; if ( Array . isArray ( res ) ) { return res ; } loggerError ( JSON . stringify ( res ) ) ; process . exit ( 1 ) ; } catch ( error ) { loggerError ( error ) ; } } ;