Skip to content
This repository was archived by the owner on Jan 15, 2022. It is now read-only.

Commit aebee97

Browse files
authored
Merge pull request #12 from spiral/pr/job-name-lowercase
Fix yaml uppercase error
2 parents 7353bb7 + 23306da commit aebee97

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

dispatcher.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ type Dispatcher map[string]*Options
1212
func (d Dispatcher) match(job *Job) (found *Options) {
1313
var best = 0
1414

15+
jobName := strings.ToLower(job.Job)
1516
for pattern, opts := range d {
1617
pattern = d.prepare(pattern)
17-
if strings.HasPrefix(job.Job, pattern) && len(pattern) > best {
18+
if strings.HasPrefix(jobName, pattern) && len(pattern) > best {
1819
found = opts
1920
best = len(pattern)
2021
}
@@ -29,5 +30,5 @@ func (d Dispatcher) match(job *Job) (found *Options) {
2930

3031
// prepare pattern for comparison
3132
func (d *Dispatcher) prepare(pattern string) string {
32-
return strings.Replace(strings.Trim(pattern, "-.*"), "-", ".", -1)
33+
return strings.ToLower(strings.Replace(strings.Trim(pattern, "-.*"), "-", ".", -1))
3334
}

0 commit comments

Comments
 (0)