(filePath: string)
| 29 | } |
| 30 | |
| 31 | async function getFile(filePath: string): Promise<string | undefined> { |
| 32 | const ref = await getMergeBaseReference(); |
| 33 | const {content, httpStatus} = await api.v3( |
| 34 | `contents/${filePath}?ref=${ref}`, |
| 35 | { |
| 36 | responseFormat: 'base64', |
| 37 | ignoreHttpStatus: 404, |
| 38 | headers: { |
| 39 | accept: 'application/vnd.github.raw', |
| 40 | }, |
| 41 | }, |
| 42 | ); |
| 43 | return httpStatus === 404 ? undefined : content; |
| 44 | } |
| 45 | |
| 46 | async function discardChanges( |
| 47 | progress: (message: string) => void, |
no test coverage detected