(owner: string, repo: string, path: string)
| 141 | } |
| 142 | |
| 143 | async getFileContent(owner: string, repo: string, path: string): Promise<string | null> { |
| 144 | try { |
| 145 | const response = await axios.get(`${this.baseURL}/repos/${owner}/${repo}/contents/${path}`, { |
| 146 | headers: this.getHeaders() |
| 147 | }); |
| 148 | |
| 149 | if (response.data.content) { |
| 150 | return Buffer.from(response.data.content, 'base64').toString('utf-8'); |
| 151 | } |
| 152 | return null; |
| 153 | } catch (error) { |
| 154 | console.error('GitHub file content error:', error); |
| 155 | return null; |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | async analyzeRepository(repo: GitHubRepo): Promise<RepoAnalysis> { |
| 160 | const [owner, repoName] = repo.full_name.split('/'); |
no test coverage detected