mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-25 01:40:30 +00:00
adb2c82790
https://go.dev/doc/modules/release-workflow#breaking Fixes https://github.com/woodpecker-ci/woodpecker/issues/2913 fixes #2654 ``` runephilosof@fedora:~/code/platform-woodpecker/woodpecker-repo-configurator (master)$ go get go.woodpecker-ci.org/woodpecker@v2.0.0 go: go.woodpecker-ci.org/woodpecker@v2.0.0: invalid version: module contains a go.mod file, so module path must match major version ("go.woodpecker-ci.org/woodpecker/v2") ``` --------- Co-authored-by: qwerty287 <80460567+qwerty287@users.noreply.github.com>
17 lines
554 B
Go
17 lines
554 B
Go
package permissions
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"go.woodpecker-ci.org/woodpecker/v2/server/model"
|
|
)
|
|
|
|
func TestOwnersAllowlist(t *testing.T) {
|
|
ol := NewOwnersAllowlist([]string{"woodpecker-ci"})
|
|
assert.True(t, ol.IsAllowed(&model.Repo{Owner: "woodpecker-ci"}))
|
|
assert.False(t, ol.IsAllowed(&model.Repo{Owner: "not-woodpecker-ci"}))
|
|
empty := NewOwnersAllowlist([]string{})
|
|
assert.True(t, empty.IsAllowed(&model.Repo{Owner: "woodpecker-ci"}))
|
|
assert.True(t, empty.IsAllowed(&model.Repo{Owner: "not-woodpecker-ci"}))
|
|
}
|