goreleaser: "git is currently in a dirty state" error message lacks information to debug the problem
Describe the bug
goreleaser
builds for my project are failing with the error message:
• releasing using goreleaser 0.104.3...
• loading config file file=.goreleaser.yaml
• RUNNING BEFORE HOOKS
• running go mod download
• GETTING AND VALIDATING GIT STATE
• releasing v1.4.2, commit 6e5813cb91d4daca0efbc4297969a9819824e342
⨯ release failed after 1.90s error=git is currently in a dirty state:
M go.mod
M go.sum
I am unable to reproduce this problem on my own machine, and the error message from goreleaser
is insufficient to know where the problem lies.
To Reproduce
Not easily reproducible, see https://travis-ci.org/twpayne/chezmoi/builds/519012274 for example output.
Expected behavior
goreleaser
prints enough information to debug where the problem is occurring. Specifically, go releaser
should emit a full git diff
not just a git status
.
Environment (please complete the following information):
- OS: Linux
- OS version: Whatever travis-ci.org is running right now
- GoReleaser Version: 0.104.3
Additional context
None, but please just say if you need any more info.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (15 by maintainers)
Commits related to this issue
- fix: small error msg improvement refs #1005 — committed to goreleaser/goreleaser by caarlos0 5 years ago
- fix: commit generated sqltext package Didn't want to do this but had trouble with Goreleaser complaining about a dirty repository --- I think this was caused by go generate modifying go.mod. Rather t... — committed to jsleeio/cloudyipam by jsleeio 4 years ago
Yay! That pretty much worked. I still have one error to fix, but it’s unrelated to this issue:
(there’s also a weird mis-match between building version 1.4.2 when the tagged version is 1.4.3, but this is for me to investigate first).
Thanks again for being super responsive - and I think that the original request in this issue (print the output of
git diff
, not just the output ofgit status
) still holds.Let’s keep this open for now. I’ll see if I can come up with a PR.
Arg
s/GOMODULE=off/GO111MODULE=off/
, retrying…Yes, please. This will help me debug the problem.
something is changing your dependencies on the CI.
The message shows the changed files:
go.mod
andgo.sum
.You can probably run
go mod tidy
locally, commitgo.sum
andgo.mod
and it should be fine.Either that or you are using
go get
on CI, which is changing thego.{mod,sum}
files…