Skip to content

Commit

Permalink
chore: Update backport script to not parse numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts committed Jul 16, 2021
1 parent 935d235 commit 02fe0d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/backport.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ const yargs = require(`yargs`)
const { Octokit } = require(`@octokit/rest`)
const childProcess = require(`child_process`)

yargs.parserConfiguration({
"parse-numbers": false,
})

if (!process.env.GITHUB_ACCESS_TOKEN) {
throw new Error(`GITHUB_ACCESS_TOKEN env var not set`)
}
Expand All @@ -22,7 +26,7 @@ const argv = yargs
.positional(`pr`, { type: `number` })
)
.check(argv => {
if (!/^3\.\d+$/.test(argv.release)) {
if (!/^[1-9][0-9]*\.\d+$/.test(argv.release)) {
throw new Error(`"${argv.release}" is not a release version`)
}

Expand Down

0 comments on commit 02fe0d9

Please sign in to comment.