File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ if (pkgVersion.includes('-') && !pkgVersion.includes('.0.0-')) {
32
32
}
33
33
34
34
const current = match . groups ;
35
- const docsBranch = `docs-v${ current ?. major ?? pkgVersion . split ( '.' ) [ 0 ] } .x` ;
35
+ const major = current ?. major ?? pkgVersion . split ( '.' ) [ 0 ] ;
36
+ const docsBranch = `docs-v${ major } .x` ;
36
37
37
38
// Fetch remotes and find the docs branch if it exists
38
39
run ( 'git fetch --all --no-tags' ) ;
@@ -52,7 +53,7 @@ if (!matchingDocsBranches) {
52
53
}
53
54
const publishedVersion = JSON . parse ( read ( `git show ${ publishedRef } :package.json` ) ) . version ;
54
55
const publishedMinor = publishedVersion . match ( / \d + \. (?< minor > \d + ) \. \d + / ) . groups . minor ;
55
- if ( current . minor < publishedMinor ) {
56
+ if ( major < publishedMinor ) {
56
57
console . error ( 'Refusing to update docs: newer version is published' ) ;
57
58
process . exit ( 0 ) ;
58
59
}
You can’t perform that action at this time.
0 commit comments