Skip to content

Commit

Permalink
Update base command computation
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed Aug 11, 2024
1 parent 7b2e9c2 commit 1487d0d
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@
public class FormattingCommand {

public static void run(GitHub gh, GHPullRequest pr, Configuration.PRActions actions, Configuration.RepoConfiguration repoConfiguration, String command, Consumer<GHWorkflowRun> onFailure, Runnable onSuccess) throws IOException {
var command2 = command;
var baseCommand = repoConfiguration.baseRunCommand();
if (baseCommand.split("\n").length > 1) {
var spl = baseCommand.split("\n", 2);
baseCommand = spl[0].trim();
command2 = spl[1].trim() + " && " + command2;
}
PRActionRunner.builder(pr)
.upload(repoConfiguration.runUploadPattern())
.command(repoConfiguration.baseRunCommand(), command)
.command(baseCommand, command2)
.onFailed((gitHub, run) -> onFailure.accept(run))
.onFinished((gitHub, run, artifact) -> {
PRRunUtils.setupPR(pr, (dir, git) -> {
Expand Down

0 comments on commit 1487d0d

Please sign in to comment.