简体   繁体   中英

does /github/home persist between github actions?

So far, I was under the impression as per the file system docs that (only?) /github/workspace persists across actions (not workflows):

The working directory of the Docker container. GitHub Actions execute in this directory. The path to this directory is set in the GITHUB_WORKSPACE environment variable.

(...)

An action can modify the contents of this directory, which subsequent actions can access.

But I now have a reprex (live repo with action runs) showing that /github/home also appears to persist across actions.

Of course I understand that none of these persist across workflows, or runs. Just between actions.

The documentation (to me) is a bit unclear about this, and I haven't gotten an answer from support.

Log from first action on /github/home :

Running 'touch /github/home/foo'...
Successfully ran 'touch /github/home/foo'

Log from second action on /github/home :

Running 'ls /github/home'...
foo
Successfully ran 'ls /github/home'
Running 'rm /github/home/foo'...
Successfully ran 'rm /github/home/foo'

That seems to suggest that indeed, /github/home also persists, but I'd like to know for sure.

GitHub Actions支持确认所有/github在整个工作流程运行中都存在。

My quick answer to your question is: /github/home doesn't persis between jobs/actions.

Following, my tests:

Write file on a job, try to read on the next

Used test file .

1) Writing on GITHUB_WORKSPACE
My path: /home/runner/work/github-actions-test/github-actions-test)
Results: writeable and readble on first job, but, empty on second job Action link

2) Writing on /github/home
My path: /github/home
Results: cannot access '/github/home/ Action link

3) Writing on /home
My path: /home
Results: touch: cannot touch '/home/myFile.txt': Permission denied
Action link

Conclusion

My conclusion for now (August 23th 2019) is that cannot persist files between jobs on any folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM