Skip to content

Commit 779232e

Browse files
committed
fix: ignore disabled azure repos from listing
1 parent 7c54e54 commit 779232e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/lib/source-handlers/azure/list-repos.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ interface AzureReposResponse {
1515
name: string;
1616
project: { name: string };
1717
defaultBranch: string;
18+
isDisabled: boolean;
1819
}[];
1920
}
2021
export async function fetchAllRepos(
@@ -61,9 +62,8 @@ async function getRepos(
6162
Response body: ${JSON.stringify(body)}`);
6263
}
6364
const { value: repos } = body;
64-
repos.map((repo) => {
65-
const { name, project, defaultBranch } = repo;
66-
if (name && project && project.name && defaultBranch) {
65+
repos.map(({ name, project, defaultBranch, isDisabled }) => {
66+
if (name && project && project.name && defaultBranch && !isDisabled) {
6767
repoList.push({
6868
name,
6969
owner: project.name,

test/lib/fixtures/azure/org-repos.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"remoteUrl": "https://dev.azure.com/remoteUrl",
5959
"sshUrl": "",
6060
"webUrl": "https://dev.azure.com/remoteUrl",
61-
"isDisabled": false
61+
"isDisabled": true
6262
}
6363
],
6464
"count": 3

test/lib/source-handlers/azure/azure.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ describe('Testing azure-devops interaction', () => {
7070
});
7171
test('Test listAzureRepos with one page', async () => {
7272
const repos = await listAzureRepos('reposTestOrg', 'https://azure-tests');
73-
expect(repos).toHaveLength(3);
73+
expect(repos).toHaveLength(2);
7474
});
7575
test('listAzureRepos to fail', async () => {
7676
expect(async () => {

0 commit comments

Comments
 (0)