Skip to content

Commit

Permalink
fix an issue where container hooks used the job default working direc…
Browse files Browse the repository at this point in the history
…tory (actions#1809)
  • Loading branch information
thboop authored Apr 6, 2022
1 parent 7b677e0 commit f48f314
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Runner.Worker/Handlers/ScriptHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ public async Task RunAsync(ActionRunStage stage)
string workingDirectory = null;
if (!Inputs.TryGetValue("workingDirectory", out workingDirectory))
{
if (string.IsNullOrEmpty(ExecutionContext.ScopeName) && ExecutionContext.Global.JobDefaults.TryGetValue("run", out var runDefaults))
// Don't use job level working directories for hooks
if (IsActionStep && string.IsNullOrEmpty(ExecutionContext.ScopeName) && ExecutionContext.Global.JobDefaults.TryGetValue("run", out var runDefaults))
{
if (runDefaults.TryGetValue("working-directory", out workingDirectory))
{
Expand Down

0 comments on commit f48f314

Please sign in to comment.