diff --git a/internal/pipe/git/errors.go b/internal/pipe/git/errors.go index f03312151..e4360f5a1 100644 --- a/internal/pipe/git/errors.go +++ b/internal/pipe/git/errors.go @@ -33,7 +33,3 @@ var ErrNotRepository = errors.New("current folder is not a git repository") // ErrNoGit happens when git is not present in PATH. var ErrNoGit = errors.New("git not present in PATH") - -// ErrShallowClone happens when goreleaser runs against a shallow copy of a repo. -// You'll need to setup your clone step to clone the whole repo instead. -var ErrShallowClone = errors.New("refusing to run against a shallow clone, please make sure to clone the whole tree") diff --git a/internal/pipe/git/git.go b/internal/pipe/git/git.go index 4fa8ec301..98cbd5998 100644 --- a/internal/pipe/git/git.go +++ b/internal/pipe/git/git.go @@ -117,7 +117,7 @@ func validate(ctx *context.Context) error { return pipe.ErrSkipValidateEnabled } if _, err := os.Stat(".git/shallow"); err == nil { - return ErrShallowClone + log.Warn("running against a shallow clone - check your CI documentation at https://goreleaser.com/ci") } out, err := git.Run("status", "--porcelain") if strings.TrimSpace(out) != "" || err != nil { diff --git a/internal/pipe/git/git_test.go b/internal/pipe/git/git_test.go index b5e2818a0..268c9877f 100644 --- a/internal/pipe/git/git_test.go +++ b/internal/pipe/git/git_test.go @@ -128,8 +128,8 @@ func TestShallowClone(t *testing.T) { ).Run(), ) t.Run("all checks up", func(t *testing.T) { - err := Pipe{}.Run(context.New(config.Project{})) - require.EqualError(t, err, ErrShallowClone.Error()) + // its just a warning now + require.NoError(t, Pipe{}.Run(context.New(config.Project{}))) }) t.Run("skip validate is set", func(t *testing.T) { ctx := context.New(config.Project{}) diff --git a/www/docs/ci/actions.md b/www/docs/ci/actions.md index 027a0eab7..9d58f83b6 100644 --- a/www/docs/ci/actions.md +++ b/www/docs/ci/actions.md @@ -45,8 +45,9 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ``` -!!! info - Note the `fetch-depth: 0` option on the `Checkout` workflow step. It is required for the change log to work correctly. +!!! warning + Note the `fetch-depth: 0` option on the `Checkout` workflow step. It is required for GoReleaser to work properly. + Without that, you might see a "refusing to run against a shallow clone" error. ### Run on new tag