1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-06-23 00:40:06 +02:00

fix: skip post-hook on universal binaries as well

closes #4278
This commit is contained in:
Carlos Alexandro Becker
2023-09-17 16:56:26 +00:00
parent 0337a0b3a8
commit d90c2ca2f2
3 changed files with 25 additions and 2 deletions

View File

@ -12,6 +12,7 @@ import (
"time"
"github.com/goreleaser/goreleaser/internal/artifact"
"github.com/goreleaser/goreleaser/internal/skips"
"github.com/goreleaser/goreleaser/internal/testctx"
"github.com/goreleaser/goreleaser/internal/testlib"
"github.com/goreleaser/goreleaser/pkg/config"
@ -329,6 +330,13 @@ func TestRun(t *testing.T) {
require.Contains(t, err.Error(), "post hook failed")
})
t.Run("skipping post-hook", func(t *testing.T) {
ctx := ctx5
skips.Set(ctx, skips.PostBuildHooks)
ctx.Config.UniversalBinaries[0].Hooks.Post = []config.Hook{{Cmd: "exit 1"}}
require.NoError(t, Pipe{}.Run(ctx))
})
t.Run("hook with env tmpl", func(t *testing.T) {
ctx := ctx5
ctx.Config.UniversalBinaries[0].Hooks.Pre = []config.Hook{{