Data sharing between github action steps

Hi. I’m trying to add log file parsing to an existing action. For this I want first to be able to share a file between two steps of an action.
Here is a pull request on my fork: Add output file parameter by bpodrygajlo · Pull Request #1 · bpodrygajlo/godot-gut-ci · GitHub
Why does this not work? I cannot seem to find the file I’ve created in the next step

Here is the latest failure:

Here is the output:

2021-11-07T20:41:42.5247076Z Output saved to /github/home/output.log
2021-11-07T20:41:43.1219443Z ##[group]Run cat /github/home/output.log
2021-11-07T20:41:43.1220123Z e[36;1mcat /github/home/output.loge[0m
2021-11-07T20:41:43.1313962Z shell: /usr/bin/bash -e {0}
2021-11-07T20:41:43.1314405Z ##[endgroup]
2021-11-07T20:41:43.1486685Z cat: /github/home/output.log: No such file or directory
2021-11-07T20:41:43.1500706Z ##[error]Process completed with exit code 1.

Is there a “good” way to do this?

Because the previous step is calling a Docker Action, and /github/home/ inside the container is different from the outside. Check the docker run command in the log, and you’ll find this volume, among other things:

-v "/home/runner/work/_temp/_github_home":"/github/home"

Usually it’s best to share files between steps by writing them to the workspace directory, which is the default working directory inside and outside action containers (unless you override it in the workflow).

Is GITHUB_WORKSPACE the location I should use?

On the host technically yes, but in the container the path is going to look different. That’s why I’m suggesting you use relative paths, which will be within the workspace automatically unless you change the working directory.