## If applied, this commit will...
If applied this change will allow goreleaser to handle relative remotes
when attempting to parse a repo URL from git.
## Why is this change being made?
To fix the error that I recently came across while trying to test my
goreleaser configuration:
```
% goreleaser check
• checking path=
⨯ configuration is invalid error=invalid scm url: .
⨯ .goreleaser.yml error=configuration is invalid: invalid scm url: .
⨯ command failed error=1 out of 1 configuration file(s) have issues
```
This change happened while on a branch doing some development. As part
of that development I needed to test a change to my goreleaser config.
My git config at the time looked like (repo obfuscated):
```
% cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = git@gitlab.com:some/repo
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "main"]
remote = origin
merge = refs/heads/main
[branch "release_fixes"]
remote = .
merge = refs/heads/main
```
It is fairly common for git to add remotes with a `.` when branch
tracking is enabled.
While, in general, there aren't many use cases that require a user to
need to release from a non-primary branch, there are cases where the
user may want to test their configuration with `goreleaser check` and
the error of `invalid scm url: .` isn't very helpful.
---------
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
basically allows to use goreleaser against a repo with a git url without both owner and repo name.
closes#3060closes#3058
Signed-off-by: Carlos A Becker <caarlos0@gmail.com>
Background
---
GitLab supports
[subgroups](https://docs.gitlab.com/ee/user/group/subgroups/) so a
repository can look something like
`gitlab.com/top-level-group/sub-group/repository` for example https://gitlab.com/gitlab-com/gl-infra/jsonnet-tool.
At the moment this detection doens't work out of the box and requires
the user to set the
[`owner`](8b0781e576/.goreleaser.yml (L32-35))
Solution
---
Instead of dropping off the nested sub-groups automatically add them.
Co-authored-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
* refactor: use t.Cleanup instead of defer
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* refactor: use t.Cleanup instead of defer
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* refactor: use t.Cleanup instead of defer
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* refactor: use t.Cleanup instead of defer
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* fix: filepath
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* refactor: use require on all tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
* refactor: use require on all tests
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
* feat: support closing milestones
Reference: https://github.com/goreleaser/goreleaser/issues/1415
* refactor: Adjust milestone handling for code simplification, add ErrNoMilestoneFound, and fix milestone documentation close default
Reference: https://github.com/goreleaser/goreleaser/pull/1657#pullrequestreview-445025743
* refactor: Use single repo config in milestones instead of each VCS
* fix: Ensure milestone Pipe is included in Defaulters
* feat: Add fail_on_error configuration to milestone configuration
Co-authored-by: Radek Simko <radek.simko@gmail.com>