Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public string GetContainerHookData()

private async Task<T> ExecuteHookScript<T>(IExecutionContext context, HookInput input, ActionRunStage stage, string prependPath) where T : HookResponse
{
bool stepFailed = false;
try
{
ValidateHookExecutable();
Expand Down Expand Up @@ -167,12 +168,13 @@ private async Task<T> ExecuteHookScript<T>(IExecutionContext context, HookInput
await handler.RunAsync(stage);
if (handler.ExecutionContext.Result == TaskResult.Failed)
{
stepFailed = true;
throw new Exception($"The hook script at '{HookScriptPath}' running command '{input.Command}' did not execute successfully");
}
var response = GetResponse<T>(input);
return response;
}
catch (Exception ex)
catch (Exception ex) when (!stepFailed)
{
throw new Exception($"Executing the custom container implementation failed. Please contact your self hosted runner administrator.", ex);
}
Expand Down