actions / actions/toolkit

[Windows] io.rmRF doesn't delete long file names

Open
#811 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug io
Dominant language
TypeScript
Stars
5.9k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
io.rmRF which can be found here, doesn't support deleting long files names.

https://github.com/actions/toolkit/blob/e9c6ee99a59ec34586d4374b68efe5cabfcee9db/packages/io/src/io.ts#L119-L123

To Reproduce

  1. Have folder/files with very long names (255+)
  2. Run: rd /s /q "${inputPath}"
  3. error: "The path ... is too long."

Expected behavior
Running a PowerShell script like this works.

Remove-Item -LiteralPath "${inputPath}" -Force -Recurse

Desktop (please complete the following information):

  • OS: Windows

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/io/src/io.ts at the linked io.rmRF implementation and reproduce deletion of a 255+ character path on Windows. Compare the failing rd /s /q behavior with the demonstrated PowerShell Remove-Item command; done means io.rmRF can delete the long-named folder without the path-too-long error.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, typescript
Domain
operating-systems, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.