mirror of
https://github.com/actions/runner.git
synced 2025-12-12 05:37:01 +00:00
Stop job container after all post actions. (#165)
* stop job container after all post actions. * c * c
This commit is contained in:
committed by
Thomas Boop
parent
51581ac865
commit
5b6f9d3b93
@@ -94,7 +94,21 @@ namespace GitHub.Runner.Worker
|
||||
{
|
||||
postDisplayName = $"Post {this.DisplayName}";
|
||||
}
|
||||
ExecutionContext.RegisterPostJobAction(postDisplayName, handlerData.CleanupCondition, Action);
|
||||
|
||||
var repositoryReference = Action.Reference as RepositoryPathReference;
|
||||
var pathString = string.IsNullOrEmpty(repositoryReference.Path) ? string.Empty : $"/{repositoryReference.Path}";
|
||||
var repoString = string.IsNullOrEmpty(repositoryReference.Ref) ? $"{repositoryReference.Name}{pathString}" :
|
||||
$"{repositoryReference.Name}{pathString}@{repositoryReference.Ref}";
|
||||
|
||||
ExecutionContext.Debug($"Register post job cleanup for action: {repoString}");
|
||||
|
||||
var actionRunner = HostContext.CreateService<IActionRunner>();
|
||||
actionRunner.Action = Action;
|
||||
actionRunner.Stage = ActionRunStage.Post;
|
||||
actionRunner.Condition = handlerData.CleanupCondition;
|
||||
actionRunner.DisplayName = postDisplayName;
|
||||
|
||||
ExecutionContext.RegisterPostJobStep($"{actionRunner.Action.Name}_post", actionRunner);
|
||||
}
|
||||
|
||||
IStepHost stepHost = HostContext.CreateService<IDefaultStepHost>();
|
||||
|
||||
Reference in New Issue
Block a user