travis-ci / travis-conditions

Boolean language for conditional builds, stages, jobs
MIT License
20 stars 4 forks source link

Regexp `\d` matching in travis-conditions but not on travis #23

Closed Ajnasz closed 1 year ago

Ajnasz commented 5 years ago

I wanted to match to semver git tag with the following regexp: /^v?\d+\.\d+\.\d+$/

$ travis-conditions eval 'tag =~ /^v?\d+\.\d+\.\d+$/' --data '{"tag": "2.12.1"}' 
true

But then on travis-ci.org it never worked. Then after a bunch of tires I tried to replace the \d with [0-9] and it worked on travis too

$ travis-conditions eval 'tag =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' --data '{"tag": "v2.12.1"}'                                                              
true

https://github.com/Ajnasz/hupper/commit/1272a371ffc4402e9e0d84f2ad669ad1045d68cf

The expected behavior would be for me is that travis-conditions prints true only if it's evaluates to true on travis as well, or the other way, if travis-conditions returns true I would expect that travis will do the same.