IssueRaiser

Add support for getting a temporary directory

The runner has a temporary directory that gets cleaned up after each job. You can access it by doing `process.env['RUNNER_TEMP']`, this can be used for a lot of things such as creating temporary files for tests or during a job and users don't need to worry about this being cleaned up. A lot of first party actions and third party actions could use this. A lot of first party actions are in-fact using the `temp` directory currently: - [cache](https://github.com/actions/toolkit/blob/4964b0cc7c5aaa2557b79cfe4bdb42dd657f6df0/packages/cache/src/internal/cacheUtils.ts#L13) - [tool-cache](https://github.com/actions/toolkit/blob/4e9375da095a1d1f59b3314589fab6cd0d215139/packages/tool-cache/src/tool-cache.ts#L663) - `setup-java` and `setup-python` will soon be using the `temp` directory too for a variety of things A method should be added to either `@actions/io` or `@actions/core` that will allow users to quickly get a temporary directory. There should also be documentation added that mentions when this gets cleaned up, and under what circumstances it won't (runner crashes)

Posted by konradpabjan on Jul 15, 2020, 3:07 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments

support (Software)

Add support for getting a temporary directory

konradpabjanJul 15, 2020, 3:07 PM

The runner has a temporary directory that gets cleaned up after each job. You can access it by doing `process.env['RUNNER_TEMP']`, this can be used for a lot of things such as creating temporary files for tests or during a job and users don't need to worry about this being cleaned up. A lot of first party actions and third party actions could use this. A lot of first party actions are in-fact using the `temp` directory currently: - [cache](https://github.com/actions/toolkit/blob/4964b0cc7c5aaa2557b79cfe4bdb42dd657f6df0/packages/cache/src/internal/cacheUtils.ts#L13) - [tool-cache](https://github.com/actions/toolkit/blob/4e9375da095a1d1f59b3314589fab6cd0d215139/packages/tool-cache/src/tool-cache.ts#L663) - `setup-java` and `setup-python` will soon be using the `temp` directory too for a variety of things A method should be added to either `@actions/io` or `@actions/core` that will allow users to quickly get a temporary directory. There should also be documentation added that mentions when this gets cleaned up, and under what circumstances it won't (runner crashes)

Comments (0)

No comments yet. Start the discussion.

Comment on this issue