mirror of
https://code.forgejo.org/forgejo/runner.git
synced 2025-10-10 19:32:04 +00:00
fix: find action.y*ml at the root of the directory
The lookup of action.y*ml files failed at the root of the directory when specified with . because it does not start with a / when walking the directory.
This commit is contained in:
parent
89f37985bd
commit
bcf2bfbf20
2 changed files with 22 additions and 4 deletions
|
@ -10,6 +10,15 @@ import (
|
|||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func Test_validatePathMatch(t *testing.T) {
|
||||
assert.False(t, validatePathMatch("nosuffix", "nosuffix"))
|
||||
assert.True(t, validatePathMatch("something.yml", "something"))
|
||||
assert.True(t, validatePathMatch("something.yaml", "something"))
|
||||
assert.False(t, validatePathMatch("entire_something.yaml", "something"))
|
||||
assert.True(t, validatePathMatch("nested/in/directory/something.yaml", "something"))
|
||||
assert.False(t, validatePathMatch("nested/in/directory/entire_something.yaml", "something"))
|
||||
}
|
||||
|
||||
func Test_validateCmd(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
for _, testCase := range []struct {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue