Skip to content

fix(cache): ensure trailing slash when joining base URL with API path#2411

Open
jjoseph456 wants to merge 1 commit into
actions:mainfrom
jjoseph456:fix/cache-url-join-slash
Open

fix(cache): ensure trailing slash when joining base URL with API path#2411
jjoseph456 wants to merge 1 commit into
actions:mainfrom
jjoseph456:fix/cache-url-join-slash

Conversation

@jjoseph456
Copy link
Copy Markdown

Problem

When ACTIONS_CACHE_URL (or ACTIONS_RESULTS_URL) does not end with a trailing slash, getCacheApiUrl() constructs an invalid URL:

https://forgejo.ellis.link_apis/artifactcache/...

instead of:

https://forgejo.ellis.link/_apis/artifactcache/...

This affects self-hosted runners and Forgejo instances where the base URL is configured without a trailing slash.

Fix

Normalize the base URL to always include a trailing slash before appending the API path segment.

Related

Fixes #2375

When ACTIONS_CACHE_URL does not end with a trailing slash, the constructed
URL becomes invalid (e.g. 'https://example.com_apis/artifactcache/...'
instead of 'https://example.com/_apis/artifactcache/...').

This normalizes the base URL to always include a trailing slash before
appending the API path segment.

Fixes actions#2375

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 18, 2026 20:08
@jjoseph456 jjoseph456 requested a review from a team as a code owner May 18, 2026 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

properly join URLs

1 participant