File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
lib/modules/versioning/ruby Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -253,6 +253,7 @@ describe('modules/versioning/ruby/index', () => {
253
253
it . each `
254
254
currentValue | rangeStrategy | currentVersion | newVersion | expected
255
255
${ '1.0.3' } | ${ 'pin' } | ${ '1.0.3' } | ${ '1.2.3' } | ${ '1.2.3' }
256
+ ${ 'v1.0.3' } | ${ 'auto' } | ${ 'v1.0.3' } | ${ 'v1.2.3' } | ${ 'v1.2.3' }
256
257
${ 'v1.0.3' } | ${ 'pin' } | ${ '1.0.3' } | ${ '1.2.3' } | ${ 'v1.2.3' }
257
258
${ '= 1.0.3' } | ${ 'pin' } | ${ '1.0.3' } | ${ '1.2.3' } | ${ '= 1.2.3' }
258
259
${ '!= 1.0.3' } | ${ 'pin' } | ${ '1.0.4' } | ${ '1.2.3' } | ${ '1.2.3' }
Original file line number Diff line number Diff line change @@ -103,7 +103,10 @@ const getNewValue = ({
103
103
} : NewValueConfig ) : string | null => {
104
104
let newValue = null ;
105
105
if ( isVersion ( currentValue ) ) {
106
- newValue = currentValue . startsWith ( 'v' ) ? 'v' + newVersion : newVersion ;
106
+ newValue =
107
+ currentValue . startsWith ( 'v' ) && ! newVersion . startsWith ( 'v' )
108
+ ? `v${ newVersion } `
109
+ : newVersion ;
107
110
} else if ( currentValue . replace ( regEx ( / ^ = \s * / ) , '' ) === currentVersion ) {
108
111
newValue = currentValue . replace ( currentVersion , newVersion ) ;
109
112
} else {
You can’t perform that action at this time.
0 commit comments