Skip to content
Open
2 changes: 1 addition & 1 deletion .github/workflows/dash-licence-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Build dash input
run: cp src/api-collector/go.sum dash-input.sum
- name: Run dash
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish_api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
outputs:
specs_exists: ${{ steps.check_specs.outputs.exists }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@v6
with:
go-version-file: "${{ env.API_COLLECTOR_DIR }}/go.mod"
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
outputs:
specs: ${{ steps.create_specs_list.outputs.matrix }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Download OpenAPI specs artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
Expand All @@ -105,7 +105,7 @@ jobs:
strategy:
matrix: ${{ fromJson(needs.generate_matrix.outputs.specs) }}
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Download OpenAPI specs artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trufflehog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0 # Ensure full clone for pull request workflows

Expand Down
38 changes: 19 additions & 19 deletions src/api-collector/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,25 +111,25 @@ func getAuthenticatedClient(ctx context.Context, gitToken string) *github.Client
}

func getOrgRepos(ctx context.Context, gitOwner string, client *github.Client) ([]*github.Repository, error) {
opt := &github.RepositoryListByOrgOptions{
ListOptions: github.ListOptions{},
}

var allRepos []*github.Repository

for {
repos, response, err := client.Repositories.ListByOrg(ctx, gitOwner, opt)
if err != nil {
return nil, err
}
allRepos = append(allRepos, repos...)
if response.NextPage == 0 {
break
}
opt.Page = response.NextPage
}

return allRepos, nil
opt := &github.RepositoryListOptions{
ListOptions: github.ListOptions{},
}

var allRepos []*github.Repository

for {
repos, response, err := client.Repositories.List(ctx, gitOwner, opt)
if err != nil {
return nil, err
}
allRepos = append(allRepos, repos...)
if response.NextPage == 0 {
break
}
opt.Page = response.NextPage
}

return allRepos, nil
}

func getAPISpecsUrlsFromMetadata(ctx context.Context, client *github.Client, owner string, repo string) ([]string, error) {
Expand Down
Loading