1
0
Fork 0
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:
Earl Warren 2025-09-17 15:37:07 +02:00
parent 89f37985bd
commit bcf2bfbf20
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
2 changed files with 22 additions and 4 deletions

View file

@ -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 {