actions / actions/toolkit

tool-cache downloadTool fails to download file saying "Invalid URL"

Open
#1,692 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug
Attempting to use tool-cache downloadTool to download Amazon Corretto 8 from the following URL results in an "Invalid URL" error.

https://corretto.aws/downloads/latest/amazon-corretto-8-x64-macos-jdk.pkg

The URL is not invalid.

To Reproduce

import * as tc from "@actions/tool-cache";
tc.downloadTool("https://corretto.aws/downloads/latest/amazon-corretto-8-x64-macos-jdk.pkg");

Notice downloadTool errors with "Invalid URL".

Expected behavior
downloadTool downloads the pkg file.

Additional context
Confirmed the issue on macos-14 runner. I suspect the issue would be present on all operating systems.

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 at the tool-cache downloadTool entry point and reproduce the failure with the Amazon Corretto URL on macos-14. Trace why this valid URL is rejected, then verify that downloadTool successfully downloads the .pkg file and that the behavior is not limited to macOS.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.