Repository: nektos/act (language: go)

Issue:
Add support for `>> $GITHUB_STEP_SUMMARY`
### Act version

0.2.34

### Feature description

With the usage of `$GITHUB_STEP_SUMMARY` in workflows it's possible to generate markdown files as a summary of a job like this:
```bash
echo "{markdown content}" >> $GITHUB_STEP_SUMMARY
``` 
The usage is pretty similar to `$GITHUB_ENV` or `$GITHUB_OUTPUT`.
Ref.: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary

However, act fails on this point, because the `$GITHUB_STEP_SUMMARY` variable is not set:
```txt
/var/run/act/workflow/3: line 14: $GITHUB_STEP_SUMMARY: ambiguous redirect
```
I don't think that `act` should actually generate a markdown file as well, IMO it's enough to just ensure that the workflow doesn't fail if the syntax is used.

Thanks for the cool project :heart: 



Discussion / hints:
Looks like `$GITHUB_STEP_SUMMARY` is unset so the redirection points to nothing and fails.

I use a workaround to have the summary working in Github Action and not crashing in Act :

``` sh
[ -w "$GITHUB_STEP_SUMMARY" ] && echo "{markdown content}" >> $GITHUB_STEP_SUMMARY
```

With the `-w` I check if `$GITHUB_STEP_SUMMARY` value is the path to a writable file and only if it is true the right part of `&&` whould be executed.

I think manually setting the value `$GITHUB_STEP_SUMMARY` could also work but I didn't tried.

You should be able to simply set this using the env flag. This way you will have control as to where you want the summary to be written to. For eg:
```
# when you just want your workflow to run without crashing and you don't care about the summary
act push --env GITHUB_STEP_SUMMARY="/dev/null"

# when you want to see whats being written
act push --env GITHUB_STEP_SUMMARY="/dev/stdout"
```

Fix patch:
diff --git a/pkg/runner/step.go b/pkg/runner/step.go
index 8a7ecc64c94..7cc355f4ed5 100644
--- a/pkg/runner/step.go
+++ b/pkg/runner/step.go
@@ -101,14 +101,22 @@ func runStepExecutor(step step, stage stepStage, executor common.Executor) commo
 
 		// Prepare and clean Runner File Commands
 		actPath := rc.JobContainer.GetActPath()
+
 		outputFileCommand := path.Join("workflow", "outputcmd.txt")
-		stateFileCommand := path.Join("workflow", "statecmd.txt")
-		pathFileCommand := path.Join("workflow", "pathcmd.txt")
-		envFileCommand := path.Join("workflow", "envs.txt")
 		(*step.getEnv())["GITHUB_OUTPUT"] = path.Join(actPath, outputFileCommand)
+
+		stateFileCommand := path.Join("workflow", "statecmd.txt")
 		(*step.getEnv())["GITHUB_STATE"] = path.Join(actPath, stateFileCommand)
+
+		pathFileCommand := path.Join("workflow", "pathcmd.txt")
 		(*step.getEnv())["GITHUB_PATH"] = path.Join(actPath, pathFileCommand)
+
+		envFileCommand := path.Join("workflow", "envs.txt")
 		(*step.getEnv())["GITHUB_ENV"] = path.Join(actPath, envFileCommand)
+
+		summaryFileCommand := path.Join("workflow", "SUMMARY.md")
+		(*step.getEnv())["GITHUB_STEP_SUMMARY"] = path.Join(actPath, summaryFileCommand)
+
 		_ = rc.JobContainer.Copy(actPath, &container.FileEntry{
 			Name: outputFileCommand,
 			Mode: 0o666,
@@ -120,6 +128,9 @@ func runStepExecutor(step step, stage stepStage, executor common.Executor) commo
 			Mode: 0o666,
 		}, &container.FileEntry{
 			Name: envFileCommand,
+			Mode: 0666,
+		}, &container.FileEntry{
+			Name: summaryFileCommand,
 			Mode: 0o666,
 		})(ctx)
 


Test patch: