Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: prepare release #724

Merged
merged 5 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
feat: add reviewpad run command
  • Loading branch information
ferreiratiago committed Feb 23, 2023
commit 81172aa7e4994a1999a9b36665a5403a017968b8
8 changes: 6 additions & 2 deletions runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,9 +335,13 @@ func Run(
command := eventDetails.Payload.(*github.IssueCommentEvent).GetComment().GetBody()
if utils.IsReviewpadCommandDryRun(command) {
return runReviewpadCommandDryRun(log, collector, gitHubClient, targetEntity, reviewpadFile, env)
} else {
return runReviewpadCommand(ctx, log, collector, gitHubClient, targetEntity, env, aladinoInterpreter, command)
}

if utils.IsReviewpadCommandRun(command) {
return runReviewpadFile(log, collector, gitHubClient, targetEntity, eventDetails, reviewpadFile, dryRun, safeMode, env, aladinoInterpreter)
}

return runReviewpadCommand(ctx, log, collector, gitHubClient, targetEntity, env, aladinoInterpreter, command)
} else {
return runReviewpadFile(log, collector, gitHubClient, targetEntity, eventDetails, reviewpadFile, dryRun, safeMode, env, aladinoInterpreter)
}
Expand Down
4 changes: 4 additions & 0 deletions utils/pr.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ func IsReviewpadCommand(eventDetails *handler.EventDetails) bool {
func IsReviewpadCommandDryRun(command string) bool {
return strings.TrimPrefix(command, "/reviewpad ") == "dry-run"
}

func IsReviewpadCommandRun(command string) bool {
return strings.TrimPrefix(command, "/reviewpad ") == "run"
}