unset GTIHUB_ACTION_REPOSITORY and GITHUB_ACTION_REF for non-repo based actions. (#804)

This commit is contained in:
Tingluo Huang
2020-12-11 11:04:07 -05:00
committed by GitHub
parent 3bce2eb09c
commit 9ceb3d481a
2 changed files with 67 additions and 2 deletions

View File

@@ -142,6 +142,11 @@ namespace GitHub.Runner.Worker
ExecutionContext.SetGitHubContext("action_repository", repoPathReferenceAction.Name);
ExecutionContext.SetGitHubContext("action_ref", repoPathReferenceAction.Ref);
}
else
{
ExecutionContext.SetGitHubContext("action_repository", null);
ExecutionContext.SetGitHubContext("action_ref", null);
}
// Setup container stephost for running inside the container.
if (ExecutionContext.Global.Container != null)
@@ -250,11 +255,11 @@ namespace GitHub.Runner.Worker
handler.PrintActionDetails(Stage);
// Run the task.
try
try
{
await handler.RunAsync(Stage);
}
finally
finally
{
fileCommandManager.ProcessFiles(ExecutionContext, ExecutionContext.Global.Container);
}