Retrieve the files from Github which are syncronized for a given repo.
(github: Octokit, repo: string)
| 27 | |
| 28 | /** Retrieve the files from Github which are syncronized for a given repo. */ |
| 29 | async function getFilesForRepo(github: Octokit, repo: string): Promise<Files> { |
| 30 | core.startGroup(`Retrieving files from "${repo}" repo`); |
| 31 | const fileMap = new Map<string, File | null>(); |
| 32 | for (const path of filesToSync) { |
| 33 | fileMap.set(path, await getFile(github, repo, path)); |
| 34 | } |
| 35 | const fileCount = [...fileMap.values()].filter((file) => file !== null).length; |
| 36 | core.info(`Retrieved ${fileCount} file(s)`); |
| 37 | core.endGroup(); |
| 38 | return fileMap; |
| 39 | } |
| 40 | |
| 41 | /** |
| 42 | * Retrieve the file content for a specified file, properly handling the file not existing in the |
no test coverage detected