diff --git a/.github/workflows/dash-licence-check.yaml b/.github/workflows/dash-licence-check.yaml index 87950caf9..97e563d78 100644 --- a/.github/workflows/dash-licence-check.yaml +++ b/.github/workflows/dash-licence-check.yaml @@ -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 diff --git a/.github/workflows/publish_api.yaml b/.github/workflows/publish_api.yaml index acf44fd0d..751a25eb2 100644 --- a/.github/workflows/publish_api.yaml +++ b/.github/workflows/publish_api.yaml @@ -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" @@ -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: @@ -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: diff --git a/.github/workflows/trufflehog.yml b/.github/workflows/trufflehog.yml index 949389839..44aeb6309 100644 --- a/.github/workflows/trufflehog.yml +++ b/.github/workflows/trufflehog.yml @@ -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 diff --git a/src/api-collector/main.go b/src/api-collector/main.go index c132301ae..6bf79fe42 100644 --- a/src/api-collector/main.go +++ b/src/api-collector/main.go @@ -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) {