Skip to content

Commit

Permalink
fixed github anka run not throwing error
Browse files Browse the repository at this point in the history
  • Loading branch information
NorseGaud committed Apr 29, 2024
1 parent c88d8de commit 67c8b15
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.0
0.3.1
20 changes: 15 additions & 5 deletions plugins/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 67c8b15

Please sign in to comment.