Skip to content

create: detect URL from latest release if it isn't archive #20156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2025

Conversation

abitrolly
Copy link
Contributor

@abitrolly abitrolly commented Jun 23, 2025

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

When running brew create https://github.com/buildpacks/pack the version is not detected from the URL, so the version from the latest release is used. But the URL still doesn't point to the source code archive. This PR constructs the URL to point to the source archive for the detected release or tag.

@MikeMcQuaid
Copy link
Member

  • Have you successfully run brew style with your changes locally?
  • Have you successfully run brew typecheck with your changes locally?
  • Have you successfully run brew tests with your changes locally?

Please always do these before opening a PR.

There's legit failures in https://github.com/Homebrew/brew/actions/runs/15821654438/job/44592172254?pr=20156

@abitrolly abitrolly force-pushed the url-from-latest-release branch from 835ebf0 to cd23c23 Compare June 24, 2025 15:50
@abitrolly
Copy link
Contributor Author

@MikeMcQuaid I simplified the logic. If version is fetched from the latest release, the URL also made to point to its source code. Without additional fetch.

@MikeMcQuaid
Copy link
Member

@abitrolly Thanks!

Detects source archive for GitHub URL without version. Both releases
and tags share the same URL pattern for source archive

  https://github.com/Homebrew/brew/releases
  https://github.com/Homebrew/brew/tags
@abitrolly abitrolly force-pushed the url-from-latest-release branch from ed0255e to 3e36e98 Compare June 26, 2025 12:09
@abitrolly
Copy link
Contributor Author

@MikeMcQuaid rebased and squashed.

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jun 26, 2025
Merged via the queue into Homebrew:main with commit c86a5a1 Jun 26, 2025
33 checks passed
@abitrolly abitrolly deleted the url-from-latest-release branch June 26, 2025 14:41
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.

2 participants