这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cmd/reviewdog/doghouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,18 @@ import (
"github.com/reviewdog/reviewdog/project"
)

func runDoghouse(ctx context.Context, r io.Reader, w io.Writer, opt *option, isProject bool, allowNonPR bool) error {
func runDoghouse(ctx context.Context, r io.Reader, w io.Writer, opt *option, isProject bool, forPr bool) error {
ghInfo, isPr, err := cienv.GetBuildInfo()
if err != nil {
return err
}
if !isPr && !allowNonPR {
if !isPr && forPr {
fmt.Fprintln(os.Stderr, "reviewdog: this is not PullRequest build.")
return nil
}
if !forPr {
ghInfo.PullRequest = 0
}
resultSet, err := checkResultSet(ctx, r, opt, isProject)
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions cmd/reviewdog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ See -reporter flag for migration and set -reporter="github-pr-review" or -report
default:
return fmt.Errorf("unknown -reporter: %s", opt.reporter)
case "github-check":
return runDoghouse(ctx, r, w, opt, isProject, true)
case "github-pr-check":
return runDoghouse(ctx, r, w, opt, isProject, false)
case "github-pr-check":
return runDoghouse(ctx, r, w, opt, isProject, true)
case "github-pr-review":
if os.Getenv("REVIEWDOG_GITHUB_API_TOKEN") == "" {
fmt.Fprintln(os.Stderr, "REVIEWDOG_GITHUB_API_TOKEN is not set")
Expand Down