1
0
mirror of https://codeberg.org/crowci/crow.git synced 2025-08-09 07:42:52 +03:00

let HookParse func explicit ignore events (#1942)

for now it's not clear defined, what to do on an unsupported event.
e.g. gitea webhook panel shows 500 error and no message.

now we have a successful webhook and a message to show an info
This commit is contained in:
6543
2023-07-14 02:03:54 +02:00
committed by GitHub
parent 004d72a853
commit d9991e67e5
13 changed files with 57 additions and 19 deletions

View File

@@ -22,8 +22,10 @@ import (
"testing"
"github.com/franela/goblin"
"github.com/stretchr/testify/assert"
"github.com/woodpecker-ci/woodpecker/server/forge/github/fixtures"
"github.com/woodpecker-ci/woodpecker/server/forge/types"
"github.com/woodpecker-ci/woodpecker/server/model"
)
@@ -50,8 +52,8 @@ func Test_parser(t *testing.T) {
p, r, b, err := parseHook(req, false)
g.Assert(r).IsNil()
g.Assert(b).IsNil()
g.Assert(err).IsNil()
g.Assert(p).IsNil()
assert.ErrorIs(t, err, &types.ErrIgnoreEvent{})
})
g.Describe("given a push hook", func() {