From 67c8b155f5adcc8cc1dbf69208d705e211629de4 Mon Sep 17 00:00:00 2001 From: Nathan Pierce Date: Mon, 29 Apr 2024 10:21:04 -0400 Subject: [PATCH] fixed github anka run not throwing error --- VERSION | 2 +- plugins/github/github.go | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 9325c3c..a2268e2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.0 \ No newline at end of file +0.3.1 \ No newline at end of file diff --git a/plugins/github/github.go b/plugins/github/github.go index 7a1a0b8..b7e50d2 100644 --- a/plugins/github/github.go +++ b/plugins/github/github.go @@ -346,25 +346,35 @@ func Run(ctx context.Context, logger *slog.Logger) { logger.WarnContext(ctx, "context canceled before install runner") return } - ankaCLI.AnkaRun(ctx, - "./install-runner.bash", - ) + installRunnerErr := ankaCLI.AnkaRun(ctx, "./install-runner.bash") + if installRunnerErr != nil { + logger.ErrorContext(ctx, "error executing install-runner.bash", "err", installRunnerErr) + return + } // Register runner if ctx.Err() != nil { logger.WarnContext(ctx, "context canceled before register runner") return } - ankaCLI.AnkaRun(ctx, + registerRunnerErr := ankaCLI.AnkaRun(ctx, "./register-runner.bash", vm.Name, *repoRunnerRegistration.Token, repositoryURL, strings.Join(workflowRunJob.Job.Labels, ","), ) + if registerRunnerErr != nil { + logger.ErrorContext(ctx, "error executing register-runner.bash", "err", registerRunnerErr) + return + } defer removeSelfHostedRunner(ctx, *vm, *workflowRunJob.Job.RunID) // Install and Start runner if ctx.Err() != nil { logger.WarnContext(ctx, "context canceled before start runner") return } - ankaCLI.AnkaRun(ctx, "./start-runner.bash") + startRunnerErr := ankaCLI.AnkaRun(ctx, "./start-runner.bash") + if startRunnerErr != nil { + logger.ErrorContext(ctx, "error executing start-runner.bash", "err", startRunnerErr) + return + } if ctx.Err() != nil { logger.WarnContext(ctx, "context canceled before jobCompleted checks") return