Skip to content

Commit c3cfdea

Browse files
committed
Filter out wikis
1 parent 7d092e2 commit c3cfdea

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/git/repository.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,11 @@ export async function getGitHubContext(): Promise<GitHubContext | undefined> {
155155
try {
156156
const git = await getGitExtension();
157157

158-
const protocolInfos = await getGitHubUrls();
158+
const allProtocolInfos = await getGitHubUrls();
159+
160+
// Filter out wiki repositories because the GET call will fail and throw an error
161+
const protocolInfos = allProtocolInfos?.filter(info => !info.protocol.repositoryName.match(/\.wiki$/));
162+
159163
if (!protocolInfos) {
160164
logDebug("Could not get protocol infos");
161165
return undefined;
@@ -174,7 +178,7 @@ export async function getGitHubContext(): Promise<GitHubContext | undefined> {
174178
return await Promise.all(
175179
protocolInfos.map(async (protocolInfo): Promise<GitHubRepoContext> => {
176180
logDebug("Getting infos for repository", protocolInfo.url);
177-
181+
178182
const repoInfo = await client.repos.get({
179183
repo: protocolInfo.protocol.repositoryName,
180184
owner: protocolInfo.protocol.owner

0 commit comments

Comments
 (0)