Skip to content

Commit

Permalink
Enable CI-Tests to run as commit-based check
Browse files Browse the repository at this point in the history
  • Loading branch information
azeemsgoogle authored and naveensrinivasan committed Mar 16, 2022
1 parent c8acf36 commit dc302bd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions clients/githubrepo/checkruns.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package githubrepo
import (
"context"
"fmt"
"strings"

"github.com/google/go-github/v38/github"

Expand All @@ -37,9 +36,6 @@ func (handler *checkrunsHandler) init(ctx context.Context, repourl *repoURL) {
}

func (handler *checkrunsHandler) listCheckRunsForRef(ref string) ([]clients.CheckRun, error) {
if !strings.EqualFold(handler.repourl.commitSHA, clients.HeadSHA) {
return nil, fmt.Errorf("%w: ListCheckRuns only supported for HEAD queries", clients.ErrUnsupportedFeature)
}
checkRuns, _, err := handler.client.Checks.ListCheckRunsForRef(
handler.ctx, handler.repourl.owner, handler.repourl.repo, ref, &github.ListCheckRunsOptions{})
if err != nil {
Expand Down
4 changes: 0 additions & 4 deletions clients/githubrepo/statuses.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package githubrepo
import (
"context"
"fmt"
"strings"

"github.com/google/go-github/v38/github"

Expand All @@ -37,9 +36,6 @@ func (handler *statusesHandler) init(ctx context.Context, repourl *repoURL) {
}

func (handler *statusesHandler) listStatuses(ref string) ([]clients.Status, error) {
if !strings.EqualFold(handler.repourl.commitSHA, clients.HeadSHA) {
return nil, fmt.Errorf("%w: ListStatuses only supported for HEAD queries", clients.ErrUnsupportedFeature)
}
statuses, _, err := handler.client.Repositories.ListStatuses(
handler.ctx, handler.repourl.owner, handler.repourl.repo, ref, &github.ListOptions{})
if err != nil {
Expand Down

0 comments on commit dc302bd

Please sign in to comment.