Skip to content

Commit

Permalink
fix(azure): exclude disabled repositories when discovering (#25104)
Browse files Browse the repository at this point in the history
Co-authored-by: Rhys Arkins <rhys@arkins.net>
  • Loading branch information
wterpstra and rarkins committed Nov 11, 2023
1 parent fbf8a15 commit 552dba5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/modules/platform/azure/index.spec.ts
Expand Up @@ -73,6 +73,14 @@ describe('modules/platform/azure/index', () => {
project: {
name: 'prj1',
},
isDisabled: false,
},
{
name: 'repoDisabled',
project: {
name: 'prj1',
},
isDisabled: true,
},
]),
}) as any,
Expand Down
4 changes: 3 additions & 1 deletion lib/modules/platform/azure/index.ts
Expand Up @@ -114,7 +114,9 @@ export async function getRepos(): Promise<string[]> {
logger.debug('Autodiscovering Azure DevOps repositories');
const azureApiGit = await azureApi.gitApi();
const repos = await azureApiGit.getRepositories();
return repos.map((repo) => `${repo.project?.name}/${repo.name}`);
return repos
.filter((repo) => repo.isDisabled !== true)
.map((repo) => `${repo.project?.name}/${repo.name}`);
}

export async function getRawFile(
Expand Down

0 comments on commit 552dba5

Please sign in to comment.