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
Explict release configuration should disable inferring release targets (multiple-tokens error) #3361
Comments
seems valid, yes, thanks for the suggestion! |
its a bit weird, but you could, in theory, set the path to a file that does not exist for the token you don't want to use, e.g.: # .goreleaser.yaml
env_files:
gitlab_token: /nope seems like an usable workaround.... |
I think that this is actually a pretty good fix, anything else I can think of is pretty much the same config with different semantics... I'll just update the docs explaining this. |
Is null a valid value here? |
it will be interpreted as a path to a file named |
Hrmm, I think that'd be odd behavior as |
ahh right, then it'll probably default to empty, which goreleaser will default the default file path for each token. my suggestion would be to set to something like |
I'd argue the non-existent path issue hides a user error (a perfectly valid path with a typo). I think it's a bit unexpected to point to a non-existent path and have it not error. But that's me. You tell me what you think is best :) I prefer being a bit stricter on inputs myself, and we cannot really tell the difference between an explicit null and an unset key in YAML, but we can tell if the value is the empty string: What we have right now:
What I think makes more sense, to me (still uses a sentinel which is a bit meh):
That's just my take, error on non-existent paths, support default behavior, but give an opt-out for the behavior. I haven't really thought about the fact that we also have POSIX environment loading here. One could get fancy and make a boolean |
if all token provider mechanisms fails, it will fail as well... it ignores file not found errors because of the defaults, and that error per se is not that relevant, whereas if that error happens and its also not possible to load any others, it means things will fail later, so it errors. anyway, for now, will proceed as said before as its 100% backward-compatible with no tricks needed. thanks! |
Makes sense, thinking about this morning I thought similarly. It's documented now, that'll work just fine. Thank you! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is your feature request related to a problem? Please describe.
I use my personal access token to release code to some projects on GitLab (private) and GitHub (public). Currently, when goreleaser has access to both tokens via
~/.config/goreleaser/gitlab_token
and~/.config/goreleaser/github_token
respectively the application fails to deploy with an error message:Describe the solution you'd like
My project's goreleaser.yml has an explicit
release
block configured. I'd like it's presence to indicate that this scm should be used, and that the inferring logic be disabled.Describe alternatives you've considered
I tried setting the env_files.gitlab_token to a custom path but that also does not work. It seems the presence of both tokens makes it impossible to opt-out of the default targets.
Search
Code of Conduct
Additional context
No response
The text was updated successfully, but these errors were encountered: