Add support for getting a temporary directory
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
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
- tool-cache
setup-javaandsetup-pythonwill soon be using thetempdirectory 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)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading packages/cache/src/internal/cacheUtils.ts and packages/tool-cache/src/tool-cache.ts, which already reference temporary-directory handling, then inspect the RUNNER_TEMP environment entry point. Determine whether @actions/io or @actions/core is the appropriate home; done means callers can obtain the runner temporary directory and documentation covers cleanup after jobs and runner crashes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, typescript
- Domain
- devops, tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100