def getChangedFiles() { return ['go/test/test.go', 'test'] } def didFileChange(reg) { return !!getChangedFiles() .find { it ==~ reg } } a = 1 if (didFileChange('go/.*.go')) { print 'yes' } else { print 'no' }