1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-17 20:47:50 +02:00
Manuel Rüger 6272ce0e6d
fix: Handle error on failed release (github) (#5106)
When trying to release an artifact to github and it fails, I observed
the following stacktrace:
```
• publishing
    • scm releases
      • releasing                                    tag=v1.11.0 repo=my-github-repo
      • could not check rate limits, hoping for the best...
      • could not check rate limits, hoping for the best...
      • took: 1m40s
  • took: 1m40s
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xe28b72]
goroutine 55 [running]:
github.com/goreleaser/goreleaser/v2/internal/client.(*githubClient).createOrUpdateRelease(0xc0001b24c8, 0xc0002c5108, 0xc000b478, {0xc00039ed00, 0x80e})
	github.com/goreleaser/goreleaser/v2@v2.2.0/internal/client/github.go:454 +0x3b2
github.com/goreleaser/goreleaser/v2/internal/client.(*githubClient).CreateRelease(0xc0001b24c8, 0xc0002c5108, {0xc00039ed00, 0x80e})
	github.com/goreleaser/goreleaser/v2@v2.2.0/internal/client/github.go:402 +0x339
github.com/goreleaser/goreleaser/v2/internal/pipe/release.doPublish(0xc0002c5108, {0x2ce2d40, 0xc0001b24c8})
...
```

I believe this happens because if the
[CreateRelease](c96ef954c3/github/repos_releases.go (L221))
fails, resp might be empty and the resp.Header does not exist, which
causes a segfault.
```
WithField("request-id", resp.Header.Get("X-GitHub-Request-Id")).
```

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2024-08-29 00:32:27 +00:00
2024-08-18 16:08:55 -03:00
2024-08-18 16:57:59 -03:00
2024-07-17 10:56:36 -03:00
2024-08-18 16:57:59 -03:00
2024-01-24 08:00:52 -03:00
2023-12-28 20:49:23 -03:00
2023-05-25 23:07:10 -03:00
2024-08-03 14:30:10 -03:00
2024-08-18 16:08:55 -03:00
2022-08-21 15:36:37 -03:00
2022-10-31 16:06:50 -03:00
2023-04-30 14:19:55 -03:00
2024-08-18 16:08:55 -03:00
2024-08-15 02:43:54 +00:00
2024-08-15 14:35:52 -03:00
2024-08-28 11:29:50 -03:00
2024-08-28 11:29:50 -03:00
2022-02-08 14:21:36 -03:00
2024-05-26 15:02:57 -03:00
2024-08-05 09:38:49 -03:00
2023-10-02 18:04:20 +00:00
2024-07-10 00:03:07 -03:00
2024-08-06 00:04:11 -03:00

GoReleaser Logo

GoReleaser

Deliver Go binaries as fast and easily as possible.


GoReleaser builds Go binaries for several platforms, creates a GitHub release and then pushes a Homebrew formula to a tap repository. All that wrapped in your favorite CI.


Get GoReleaser

Documentation

Documentation is hosted live at https://goreleaser.com

Community

You have questions, need support and or just want to talk about GoReleaser?

Here are ways to get in touch with the GoReleaser community:

Join Discord Follow Twitter GitHub Discussions

You can find the links above and all others here.

Code of Conduct

This project adheres to the Contributor Covenant code of conduct. By participating, you are expected to uphold this code. We appreciate your contribution. Please refer to our contributing guidelines for further information.

Badges

Release Software License Build status Codecov branch Artifact Hub Go Doc Powered By: GoReleaser Backers on Open Collective Sponsors on Open Collective Conventional Commits CII Best Practices

GitHub Sponsors

High-tier sponsors of @caarlos0 on GitHub:

OpenCollective

Sponsors

Does your company use goreleaser? Help keep the project bug-free and feature rich by sponsoring the project.

Backers

Love our work and community? Become a backer.

Contributors

This project exists thanks to all the people who contribute. [Contribute].

Stargazers over time

Stargazers over time

Languages
Go 93.4%
Nix 2.1%
Ruby 2%
YAML 1%
HTML 0.6%
Other 0.9%