diff --git a/pkg/git/github.go b/pkg/git/github.go index 3a431e5..1354830 100644 --- a/pkg/git/github.go +++ b/pkg/git/github.go @@ -2,7 +2,6 @@ package git import ( "context" - "errors" "fmt" "io/ioutil" "net/http" @@ -56,18 +55,6 @@ func NewGitHubGITProvider(ctx context.Context, remoteURL, token string) (*GitHub client := github.NewClient(tc) - _, _, err = client.Repositories.List(ctx, "", nil) - if err != nil { - var githubError *github.ErrorResponse - if errors.As(err, &githubError) { - if githubError.Response.StatusCode == 401 { - return nil, fmt.Errorf("unable to authenticate using token") - } - } - - return nil, err - } - return &GitHubGITProvider{ authClient: tc, client: client, diff --git a/pkg/git/github_test.go b/pkg/git/github_test.go index 56d4dc5..222e0d0 100644 --- a/pkg/git/github_test.go +++ b/pkg/git/github_test.go @@ -103,11 +103,6 @@ var _ = Describe("NewGitHubGITProvider", func() { Expect(err).To(MatchError("host does not start with https://github.com: https://foo.bar")) }) - It("returns error when creating with fake token", func() { - _, err = NewGitHubGITProvider(ctx, "https://github.com/org/repo", "foo") - Expect(err).To(MatchError("unable to authenticate using token")) - }) - It("is successfully created when creating with correct token", func() { var provider *GitHubGITProvider remoteURL := os.Getenv("GITHUB_URL") diff --git a/pkg/git/provider_test.go b/pkg/git/provider_test.go index d8e8b8c..ddcee7d 100644 --- a/pkg/git/provider_test.go +++ b/pkg/git/provider_test.go @@ -24,14 +24,6 @@ func TestNewGitProvider(t *testing.T) { token: "fake", expectedError: "TF400813: The user '' is not authorized to access this resource.", }, - { - testDescription: "github provider returns error", - providerString: "github", - expectedProviderType: ProviderTypeGitHub, - remoteURL: "https://github.com/organization/repository", - token: "fake", - expectedError: "unable to authenticate using token", - }, { testDescription: "fake provider returns error", providerString: "fake",