1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2024-12-31 01:53:50 +02:00
goreleaser/internal
Aaron U'Ren 917cae54f0
fix(config): handle relative git repos (#4575)
## 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>
2024-01-29 10:31:19 -03:00
..
archivefiles refactor: add function to apply template multiple times (#4158) 2023-06-30 14:46:53 -03:00
artifact fix: prevent having whitespaces in artifact names (#4515) 2024-01-07 14:16:33 -03:00
builders test: run testifylint -fix (#4483) 2023-12-17 15:34:28 -03:00
client fix: possible nil pointers on logs 2024-01-21 21:46:59 -03:00
commitauthor test: run testifylint -fix (#4483) 2023-12-17 15:34:28 -03:00
deprecate feat: improve output (#4206) 2023-07-25 08:26:44 -03:00
exec feat: improve template error handling (#4256) 2023-08-24 22:06:12 -03:00
extrafiles feat: improve template error handling (#4256) 2023-08-24 22:06:12 -03:00
gio test: run testifylint -fix (#4483) 2023-12-17 15:34:28 -03:00
git fix(config): handle relative git repos (#4575) 2024-01-29 10:31:19 -03:00
golden feat: winget support (#4081) 2023-06-14 23:59:55 -03:00
http refactor(http): remove redundant nil check (#4563) 2024-01-21 21:51:03 -03:00
ids chore: gofumpt & lint (#2190) 2021-04-25 14:20:49 -03:00
logext feat: improve output (#4206) 2023-07-25 08:26:44 -03:00
middleware test: run testifylint -fix (#4483) 2023-12-17 15:34:28 -03:00
pipe fix(nix): prevent importing makeWrapper when it's not needed 2024-01-27 09:12:55 -03:00
pipeline feat: improve --single-target (#4442) 2023-11-27 18:29:50 -03:00
semerrgroup fix: improve skip details (#4522) 2024-01-07 14:12:50 -03:00
shell feat: improve project and build hooks error handling 2023-11-29 22:01:13 -03:00
skips fix: build does not run chocolatey 2024-01-14 15:26:16 -03:00
static docs: fix typos (#4406) 2023-11-06 09:14:07 -03:00
testctx feat: improve --single-target (#4442) 2023-11-27 18:29:50 -03:00
testlib test: run testifylint -fix (#4483) 2023-12-17 15:34:28 -03:00
tmpl feat(tmpl): .GitTreeState and .IsGitClean 2024-01-18 08:07:38 -03:00
yaml feat(yaml): upgraded from yaml.v2 to yaml.v3 (#3004) 2022-03-29 14:00:53 -03:00