Skip to content

Commit

Permalink
fix(google/go-github): address the breaking change of go-github
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Oct 16, 2023
1 parent b223fae commit c92db87
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/download/github_archive.go
Expand Up @@ -18,7 +18,7 @@ func (dl *Downloader) getReadCloserFromGitHubArchive(ctx context.Context, file *
}
u, _, err := dl.github.GetArchiveLink(ctx, file.RepoOwner, file.RepoName, github.Tarball, &github.RepositoryContentGetOptions{
Ref: file.Version,
}, true)
}, 2)

Check failure on line 21 in pkg/download/github_archive.go

View workflow job for this annotation

GitHub Actions / test / test

mnd: Magic number: 2, in <argument> detected (gomnd)
if err != nil {
return nil, 0, fmt.Errorf("git an archive link with GitHub API: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/github/github.go
Expand Up @@ -31,7 +31,7 @@ func New(ctx context.Context) *RepositoriesServiceImpl {
}

type RepositoriesService interface {
GetArchiveLink(ctx context.Context, owner, repo string, archiveformat github.ArchiveFormat, opts *github.RepositoryContentGetOptions, followRedirects bool) (*url.URL, *github.Response, error)
GetArchiveLink(ctx context.Context, owner, repo string, archiveformat github.ArchiveFormat, opts *github.RepositoryContentGetOptions, maxRedirects int) (*url.URL, *github.Response, error)
GetReleaseByTag(ctx context.Context, owner, repoName, version string) (*github.RepositoryRelease, *github.Response, error)
DownloadReleaseAsset(ctx context.Context, owner, repoName string, assetID int64, httpClient *http.Client) (io.ReadCloser, string, error)
GetContents(ctx context.Context, repoOwner, repoName, path string, opt *github.RepositoryContentGetOptions) (*github.RepositoryContent, []*github.RepositoryContent, *github.Response, error)
Expand Down
2 changes: 1 addition & 1 deletion pkg/github/mock.go
Expand Up @@ -73,7 +73,7 @@ func (m *MockRepositoriesService) ListTags(ctx context.Context, owner string, re
return m.Tags, nil, nil
}

func (m *MockRepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat github.ArchiveFormat, opts *github.RepositoryContentGetOptions, followRedirects bool) (*url.URL, *github.Response, error) {
func (m *MockRepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat github.ArchiveFormat, opts *github.RepositoryContentGetOptions, maxRedirects int) (*url.URL, *github.Response, error) {
if m.URL == nil {
return nil, nil, errGetTar
}
Expand Down

0 comments on commit c92db87

Please sign in to comment.