Skip to content

fix: do not get releases.json if version is specific#502

Merged
crazy-max merged 2 commits into
masterfrom
releases-json
Aug 2, 2025
Merged

fix: do not get releases.json if version is specific#502
crazy-max merged 2 commits into
masterfrom
releases-json

Conversation

@caarlos0

@caarlos0 caarlos0 commented Aug 2, 2025

Copy link
Copy Markdown
Member

closes #489

@caarlos0 caarlos0 requested review from Copilot and crazy-max August 2, 2025 03:55
@caarlos0 caarlos0 self-assigned this Aug 2, 2025
@caarlos0 caarlos0 added the enhancement New feature or request label Aug 2, 2025

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes the GitHub release resolution process by skipping the expensive JSON fetch operation when a specific version (not a version range) is requested. Instead of always checking the releases JSON file, it validates if the version is a specific semantic version and directly constructs the tag name.

Key changes:

  • Added early return path for specific semantic versions to avoid unnecessary network calls
  • Preserved existing logic for handling GoReleaser Pro suffix for versions < 2.7.0
  • Added comprehensive test coverage for the new optimization path

Reviewed Changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/github.ts Implements early return optimization for specific versions in getReleaseTag function
tests/github.test.ts Adds test cases to verify the optimization works for versions with and without 'v' prefix

Comment thread src/github.ts
@crazy-max crazy-max merged commit 9a6cd01 into master Aug 2, 2025
39 checks passed
@crazy-max crazy-max deleted the releases-json branch August 2, 2025 08:24
scornet256 added a commit to scornet256/gogitlabber that referenced this pull request May 18, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [goreleaser/goreleaser-action](https://github.com/goreleaser/goreleaser-action) | action | major | `v6` → `v7` |

---

### Release Notes

<details>
<summary>goreleaser/goreleaser-action (goreleaser/goreleaser-action)</summary>

### [`v7.2.1`](https://github.com/goreleaser/goreleaser-action/releases/tag/v7.2.1)

[Compare Source](goreleaser/goreleaser-action@v7.2.0...v7.2.1)

This fully removes the usage of the old `nightly` moving tag.

**Full Changelog**: <goreleaser/goreleaser-action@v7.2.0...v7.2.1>

### [`v7.2.0`](https://github.com/goreleaser/goreleaser-action/releases/tag/v7.2.0)

[Compare Source](goreleaser/goreleaser-action@v7.1.0...v7.2.0)

#### What's Changed

- test: cover install across release eras by [@&#8203;caarlos0](https://github.com/caarlos0) in [#&#8203;555](goreleaser/goreleaser-action#555)
- feat: add `version-file` input by [@&#8203;caarlos0](https://github.com/caarlos0) in [#&#8203;556](goreleaser/goreleaser-action#556)
- feat: resolve nightly to latest vX.Y.Z-<sha>-nightly release by [@&#8203;caarlos0](https://github.com/caarlos0) in [#&#8203;558](goreleaser/goreleaser-action#558)

**Full Changelog**: <goreleaser/goreleaser-action@v7...v7.2.0>

### [`v7.1.0`](https://github.com/goreleaser/goreleaser-action/releases/tag/v7.1.0)

[Compare Source](goreleaser/goreleaser-action@v7...v7.1.0)

#### What's Changed

- feat: verify release checksum and cosign signature by [@&#8203;caarlos0](https://github.com/caarlos0) in [#&#8203;550](goreleaser/goreleaser-action#550)
- docs: document cosign verification in README by [@&#8203;caarlos0](https://github.com/caarlos0) in [#&#8203;553](goreleaser/goreleaser-action#553)
- docs: Upgrade import GPG action version by [@&#8203;flecno](https://github.com/flecno) in [#&#8203;547](goreleaser/goreleaser-action#547)
- ci: drop docker-bake in favor of plain npm by [@&#8203;caarlos0](https://github.com/caarlos0) in [#&#8203;551](goreleaser/goreleaser-action#551)
- ci: add release-major-tag workflow by [@&#8203;caarlos0](https://github.com/caarlos0) in [#&#8203;552](goreleaser/goreleaser-action#552)
- ci: drop pre-cosign-v3 goreleaser versions from tests by [@&#8203;caarlos0](https://github.com/caarlos0) in [#&#8203;554](goreleaser/goreleaser-action#554)
- ci(deps): bump the actions group with 2 updates by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;543](goreleaser/goreleaser-action#543)
- ci(deps): bump the actions group with 5 updates by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;546](goreleaser/goreleaser-action#546)
- chore(deps): bump undici from 6.23.0 to 6.24.1 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;545](goreleaser/goreleaser-action#545)

#### New Contributors

- [@&#8203;flecno](https://github.com/flecno) made their first contribution in [#&#8203;547](goreleaser/goreleaser-action#547)

**Full Changelog**: <goreleaser/goreleaser-action@v7...v7.1.0>

### [`v7.0.0`](https://github.com/goreleaser/goreleaser-action/releases/tag/v7.0.0)

[Compare Source](goreleaser/goreleaser-action@v7...v7)

#### What's Changed

- feat!: node 24, update deps, rm yarn, ESM by [@&#8203;caarlos0](https://github.com/caarlos0) in [#&#8203;533](goreleaser/goreleaser-action#533)
- sec: pin github action versions by [@&#8203;caarlos0](https://github.com/caarlos0) in [#&#8203;514](goreleaser/goreleaser-action#514)
- docs: Upgrade checkout GitHub Action in README.md by [@&#8203;dunglas](https://github.com/dunglas) in [#&#8203;507](goreleaser/goreleaser-action#507)
- chore(deps): bump actions/checkout from 4 to 5 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;504](goreleaser/goreleaser-action#504)
- ci(deps): bump the actions group with 2 updates by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;517](goreleaser/goreleaser-action#517)
- ci(deps): bump the actions group with 2 updates by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;523](goreleaser/goreleaser-action#523)
- ci(deps): bump docker/bake-action from 6.9.0 to 6.10.0 in the actions group by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;526](goreleaser/goreleaser-action#526)
- ci(deps): bump the actions group across 1 directory with 4 updates by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;532](goreleaser/goreleaser-action#532)
- ci(deps): bump actions/checkout from 6.0.1 to 6.0.2 in the actions group by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;534](goreleaser/goreleaser-action#534)
- chore(deps): bump the npm group across 1 directory with 4 updates by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;536](goreleaser/goreleaser-action#536)
- chore(deps): bump [@&#8203;actions/http-client](https://github.com/actions/http-client) from 3.0.2 to 4.0.0 in the npm group by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;537](goreleaser/goreleaser-action#537)
- ci(deps): bump docker/setup-buildx-action from 3.10.0 to 3.12.0 in the actions group by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;538](goreleaser/goreleaser-action#538)
- chore(deps): bump semver from 7.7.3 to 7.7.4 in the npm group by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;539](goreleaser/goreleaser-action#539)

**Full Changelog**: <goreleaser/goreleaser-action@v6...v7.0.0>

### [`v7`](goreleaser/goreleaser-action@v6.4.0...v7)

[Compare Source](goreleaser/goreleaser-action@v6.4.0...v7)

### [`v6.4.0`](https://github.com/goreleaser/goreleaser-action/releases/tag/v6.4.0)

[Compare Source](goreleaser/goreleaser-action@v6.3.0...v6.4.0)

#### What's Changed

- ci: set contents read as default workflow permissions by [@&#8203;crazy-max](https://github.com/crazy-max) in [#&#8203;494](goreleaser/goreleaser-action#494)
- fix: support .config directory for goreleaser config files  by [@&#8203;haya14busa](https://github.com/haya14busa) in [#&#8203;500](goreleaser/goreleaser-action#500)
- chore(deps): bump semver from 7.7.1 to 7.7.2 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;495](goreleaser/goreleaser-action#495)
- chore(deps): bump brace-expansion from 1.1.11 to 1.1.12 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;498](goreleaser/goreleaser-action#498)
- fix: do not get releases.json if version is specific by [@&#8203;caarlos0](https://github.com/caarlos0) in [#&#8203;502](goreleaser/goreleaser-action#502)
- chore(deps): bump undici from 5.28.5 to 5.29.0 by [@&#8203;dependabot](https://github.com/dependabot)\[bot] in [#&#8203;496](goreleaser/goreleaser-action#496)
- feat: retry downloading releases json by [@&#8203;caarlos0](https://github.com/caarlos0) in [#&#8203;503](goreleaser/goreleaser-action#503)

#### New Contributors

- [@&#8203;haya14busa](https://github.com/haya14busa) made their first contribution in [#&#8203;500](goreleaser/goreleaser-action#500)

**Full Changelog**: <goreleaser/goreleaser-action@v6.3.0...v6.4.0>

### [`v6.3.0`](https://github.com/goreleaser/goreleaser-action/releases/tag/v6.3.0)

[Compare Source](goreleaser/goreleaser-action@v6.2.1...v6.3.0)

- Bump undici from 5.28.3 to 5.28.5 in [#&#8203;488](goreleaser/goreleaser-action#488)

**Full Changelog**: <goreleaser/goreleaser-action@v6.2.1...v6.3.0>

### [`v6.2.1`](https://github.com/goreleaser/goreleaser-action/releases/tag/v6.2.1)

[Compare Source](goreleaser/goreleaser-action@v6.2.0...v6.2.1)

#### What's Changed

This version of the actions adds support for GoReleaser Pro v2.7.0 versioning (which dropped the `-pro` suffix).
Older versions should work fine.

> \[!WARNING]
> This version is **required** for GoReleaser Pro v2.7.0+.
> Read more [here](https://goreleaser.com/blog/goreleaser-v2.7/).

**Full Changelog**: <goreleaser/goreleaser-action@v6.2.0...v6.2.1>

### [`v6.2.0`](https://github.com/goreleaser/goreleaser-action/releases/tag/v6.2.0)

[Compare Source](goreleaser/goreleaser-action@v6.1.0...v6.2.0)

#### What's Changed

This version of the actions adds support for GoReleaser Pro v2.7.0 versioning (which dropped the `-pro` suffix).
Older versions should work fine.

> \[!WARNING]
> This version is **required** for GoReleaser Pro v2.7.0+.
> Read more [here](https://goreleaser.com/blog/goreleaser-v2.7/).

**Full Changelog**: <goreleaser/goreleaser-action@v6.1.0...v6.2.0>

### [`v6.1.0`](https://github.com/goreleaser/goreleaser-action/releases/tag/v6.1.0)

[Compare Source](goreleaser/goreleaser-action@v6...v6.1.0)

#### What's Changed

- chore(deps): bump braces from 3.0.2 to 3.0.3 by [@&#8203;dependabot](https://github.com/dependabot) in [#&#8203;467](goreleaser/goreleaser-action#467)
- chore(deps): bump docker/bake-action from 4 to 5 by [@&#8203;dependabot](https://github.com/dependabot) in [#&#8203;468](goreleaser/goreleaser-action#468)
- chore(deps): bump semver from 7.6.2 to 7.6.3 by [@&#8203;dependabot](https://github.com/dependabot) in [#&#8203;470](goreleaser/goreleaser-action#470)
- chore(deps): bump [@&#8203;actions/http-client](https://github.com/actions/http-client) from 2.2.1 to 2.2.2 by [@&#8203;dependabot](https://github.com/dependabot) in [#&#8203;473](goreleaser/goreleaser-action#473)
- chore(deps): bump [@&#8203;actions/http-client](https://github.com/actions/http-client) from 2.2.2 to 2.2.3 by [@&#8203;dependabot](https://github.com/dependabot) in [#&#8203;474](goreleaser/goreleaser-action#474)
- chore(deps): bump micromatch from 4.0.5 to 4.0.8 by [@&#8203;dependabot](https://github.com/dependabot) in [#&#8203;475](goreleaser/goreleaser-action#475)
- chore(deps): bump [@&#8203;actions/core](https://github.com/actions/core) from 1.10.1 to 1.11.1 by [@&#8203;dependabot](https://github.com/dependabot) in [#&#8203;478](goreleaser/goreleaser-action#478)
- docs: bump upload-artifact version by [@&#8203;dunglas](https://github.com/dunglas) in [#&#8203;479](goreleaser/goreleaser-action#479)
- chore: update generated content by [@&#8203;crazy-max](https://github.com/crazy-max) in [#&#8203;480](goreleaser/goreleaser-action#480)

#### New Contributors

- [@&#8203;dunglas](https://github.com/dunglas) made their first contribution in [#&#8203;479](goreleaser/goreleaser-action#479)

**Full Changelog**: <goreleaser/goreleaser-action@v6.0.0...v6.1.0>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNjUuMiIsInVwZGF0ZWRJblZlciI6IjQzLjE2NS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://git.simoncor.net/golang/gogitlabber/pulls/2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide an option to skip version check over https://goreleaser.com/static/releases.json

4 participants