Skip to content

fix: use latest in URL when version is empty - #1064

Merged
shivammathur merged 1 commit into
shivammathur:mainfrom
theluckystrike:main
Mar 4, 2026
Merged

shivammathur merged 1 commit into
shivammathur:mainfrom
theluckystrike:main

Conversation

@theluckystrike

@theluckystrike theluckystrike commented Mar 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1063

When version is not specified (empty string), the getUrl function was generating invalid URLs like without any version, which returned 404.

This fix ensures that when version is empty or 'latest', the URL includes '/latest/' which GitHub handles correctly with a redirect to the actual latest release.


Contributed by theluckystrike | Zovo — Chrome Extension Studio

When version is not specified (empty string), the getUrl function
was generating invalid URLs like /releases/download/cs2pr without
any version, which returned 404.

This fix ensures that when version is empty or 'latest', the URL
includes '/latest/' which GitHub handles correctly with a redirect
to the actual latest release.

Fixes #1063
@codecov

codecov Bot commented Mar 4, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a8ca9e3) to head (746e1a4).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1064   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         8           
  Lines          852       853    +1     
  Branches       302       303    +1     
=========================================
+ Hits           852       853    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@shivammathur
shivammathur merged commit 650d05d into shivammathur:main Mar 4, 2026
70 checks passed
@shivammathur

Copy link
Copy Markdown
Owner

@theluckystrike Thanks!

@staabm

staabm commented Mar 4, 2026

Copy link
Copy Markdown

thank you!

@theluckystrike

Copy link
Copy Markdown
Contributor Author

@shivammathur, thanks for merging #1064 back in March. Tools set up without a version now download from the releases/latest path instead of a URL that returned 404.

Seeing it merged tells me the effort counted. If a small one-time sponsorship ever appeals, https://github.com/sponsors/theluckystrike is where it goes, and https://github.com/theluckystrike lists the rest of my work. It'd be a quiet signal that the effort was welcome, and setup-php would keep getting fixes from me, though it's completely fine if not.

Thank you,
Michael Lip
Founder of https://zovo.one, 108 Chrome extensions with 150,000+ users
Also building https://makeroll.com and https://ml0x.com, open-source guardrails for Claude Code agents
Open source has to win, and small fixes like this one are my part of it

@theluckystrike

Copy link
Copy Markdown
Contributor Author

@shivammathur, thanks for the thumbs up, and thanks again for merging #1064. Since that change, setup-php builds the tool URL from releases/latest when no version is given, so those installs don't hit a 404 anymore.

Appreciate you reading the note.

Thank you,
Michael Lip

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.

Bug: cs2pr Failed to download cs2pr

3 participants