Bump semver from 7.3.8 to 7.5.2 (#34)

pull/35/head
MaksimZhukov 2 years ago committed by GitHub
parent 337dee4c7b
commit e8908aab06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,9 +1,9 @@
--- ---
name: semver name: semver
version: 7.3.8 version: 7.5.4
type: npm type: npm
summary: The semantic version parser used by npm. summary: The semantic version parser used by npm.
homepage: https://github.com/npm/node-semver#readme homepage:
license: isc license: isc
licenses: licenses:
- sources: LICENSE - sources: LICENSE

512
dist/index.js vendored

@ -5,104 +5,104 @@
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
})); }));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.postMessageToSlack = exports.updateTag = exports.validateIfReleaseIsPublished = void 0; exports.postMessageToSlack = exports.updateTag = exports.validateIfReleaseIsPublished = void 0;
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const github_1 = __nccwpck_require__(5438); const github_1 = __nccwpck_require__(5438);
const http_client_1 = __nccwpck_require__(9925); const http_client_1 = __nccwpck_require__(9925);
async function findTag(tag, octokitClient) { async function findTag(tag, octokitClient) {
try { try {
const { data: foundTag } = await octokitClient.git.getRef({ const { data: foundTag } = await octokitClient.git.getRef({
...github_1.context.repo, ...github_1.context.repo,
ref: `tags/${tag}` ref: `tags/${tag}`
}); });
return foundTag; return foundTag;
} }
catch (err) { catch (err) {
if (err.status === 404) { if (err.status === 404) {
return null; return null;
} }
else { else {
throw new Error(`Retrieving refs failed with the following error: ${err}`); throw new Error(`Retrieving refs failed with the following error: ${err}`);
} }
} }
} }
async function getTagSHA(tag, octokitClient) { async function getTagSHA(tag, octokitClient) {
const foundTag = await findTag(tag, octokitClient); const foundTag = await findTag(tag, octokitClient);
if (!foundTag) { if (!foundTag) {
throw new Error(`The '${tag}' tag does not exist in the remote repository`); throw new Error(`The '${tag}' tag does not exist in the remote repository`);
} }
return foundTag.object.sha; return foundTag.object.sha;
} }
async function validateIfReleaseIsPublished(tag, octokitClient) { async function validateIfReleaseIsPublished(tag, octokitClient) {
try { try {
const { data: foundRelease } = await octokitClient.repos.getReleaseByTag({ const { data: foundRelease } = await octokitClient.repos.getReleaseByTag({
...github_1.context.repo, ...github_1.context.repo,
tag tag
}); });
if (foundRelease.prerelease) { if (foundRelease.prerelease) {
throw new Error(`The '${foundRelease.name}' release is marked as pre-release. Updating tags for pre-release is not supported`); throw new Error(`The '${foundRelease.name}' release is marked as pre-release. Updating tags for pre-release is not supported`);
} }
} }
catch (err) { catch (err) {
if (err.status === 404) { if (err.status === 404) {
throw new Error(`No GitHub release found for the ${tag} tag`); throw new Error(`No GitHub release found for the ${tag} tag`);
} }
else { else {
throw new Error(`Retrieving releases failed with the following error: ${err}`); throw new Error(`Retrieving releases failed with the following error: ${err}`);
} }
} }
} }
exports.validateIfReleaseIsPublished = validateIfReleaseIsPublished; exports.validateIfReleaseIsPublished = validateIfReleaseIsPublished;
async function updateTag(sourceTag, targetTag, octokitClient) { async function updateTag(sourceTag, targetTag, octokitClient) {
const sourceTagSHA = await getTagSHA(sourceTag, octokitClient); const sourceTagSHA = await getTagSHA(sourceTag, octokitClient);
const foundTargetTag = await findTag(targetTag, octokitClient); const foundTargetTag = await findTag(targetTag, octokitClient);
const refName = `tags/${targetTag}`; const refName = `tags/${targetTag}`;
if (foundTargetTag) { if (foundTargetTag) {
core.info(`Updating the '${targetTag}' tag to point to the '${sourceTag}' tag`); core.info(`Updating the '${targetTag}' tag to point to the '${sourceTag}' tag`);
await octokitClient.git.updateRef({ await octokitClient.git.updateRef({
...github_1.context.repo, ...github_1.context.repo,
ref: refName, ref: refName,
sha: sourceTagSHA, sha: sourceTagSHA,
force: true force: true
}); });
} }
else { else {
core.info(`Creating the '${targetTag}' tag from the '${sourceTag}' tag`); core.info(`Creating the '${targetTag}' tag from the '${sourceTag}' tag`);
await octokitClient.git.createRef({ await octokitClient.git.createRef({
...github_1.context.repo, ...github_1.context.repo,
ref: `refs/${refName}`, ref: `refs/${refName}`,
sha: sourceTagSHA sha: sourceTagSHA
}); });
} }
} }
exports.updateTag = updateTag; exports.updateTag = updateTag;
async function postMessageToSlack(slackWebhook, message) { async function postMessageToSlack(slackWebhook, message) {
const jsonData = { text: message }; const jsonData = { text: message };
const http = new http_client_1.HttpClient(); const http = new http_client_1.HttpClient();
await http.postJson(slackWebhook, jsonData); await http.postJson(slackWebhook, jsonData);
} }
exports.postMessageToSlack = postMessageToSlack; exports.postMessageToSlack = postMessageToSlack;
/***/ }), /***/ }),
@ -111,59 +111,59 @@ exports.postMessageToSlack = postMessageToSlack;
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict"; "use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) { }) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k; if (k2 === undefined) k2 = k;
o[k2] = m[k]; o[k2] = m[k];
})); }));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v }); Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) { }) : function(o, v) {
o["default"] = v; o["default"] = v;
}); });
var __importStar = (this && this.__importStar) || function (mod) { var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod; if (mod && mod.__esModule) return mod;
var result = {}; var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod); __setModuleDefault(result, mod);
return result; return result;
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
const core = __importStar(__nccwpck_require__(2186)); const core = __importStar(__nccwpck_require__(2186));
const github = __importStar(__nccwpck_require__(5438)); const github = __importStar(__nccwpck_require__(5438));
const github_1 = __nccwpck_require__(5438); const github_1 = __nccwpck_require__(5438);
const api_utils_1 = __nccwpck_require__(2430); const api_utils_1 = __nccwpck_require__(2430);
const version_utils_1 = __nccwpck_require__(1534); const version_utils_1 = __nccwpck_require__(1534);
async function run() { async function run() {
try { try {
const token = core.getInput('token'); const token = core.getInput('token');
const octokitClient = github.getOctokit(token); const octokitClient = github.getOctokit(token);
const sourceTagName = core.getInput('source-tag'); const sourceTagName = core.getInput('source-tag');
version_utils_1.validateSemverVersionFromTag(sourceTagName); version_utils_1.validateSemverVersionFromTag(sourceTagName);
await api_utils_1.validateIfReleaseIsPublished(sourceTagName, octokitClient); await api_utils_1.validateIfReleaseIsPublished(sourceTagName, octokitClient);
const majorTag = version_utils_1.getMajorTagFromFullTag(sourceTagName); const majorTag = version_utils_1.getMajorTagFromFullTag(sourceTagName);
await api_utils_1.updateTag(sourceTagName, majorTag, octokitClient); await api_utils_1.updateTag(sourceTagName, majorTag, octokitClient);
core.setOutput('major-tag', majorTag); core.setOutput('major-tag', majorTag);
core.info(`The '${majorTag}' major tag now points to the '${sourceTagName}' tag`); core.info(`The '${majorTag}' major tag now points to the '${sourceTagName}' tag`);
const slackMessage = `The ${majorTag} tag has been successfully updated for the ${github_1.context.repo.repo} action to include changes from ${sourceTagName}`; const slackMessage = `The ${majorTag} tag has been successfully updated for the ${github_1.context.repo.repo} action to include changes from ${sourceTagName}`;
await reportStatusToSlack(slackMessage); await reportStatusToSlack(slackMessage);
} }
catch (error) { catch (error) {
core.setFailed(error.message); core.setFailed(error.message);
const slackMessage = `Failed to update a major tag for the ${github_1.context.repo.repo} action`; const slackMessage = `Failed to update a major tag for the ${github_1.context.repo.repo} action`;
await reportStatusToSlack(slackMessage); await reportStatusToSlack(slackMessage);
} }
} }
async function reportStatusToSlack(message) { async function reportStatusToSlack(message) {
const slackWebhook = core.getInput('slack-webhook'); const slackWebhook = core.getInput('slack-webhook');
if (slackWebhook) { if (slackWebhook) {
await api_utils_1.postMessageToSlack(slackWebhook, message); await api_utils_1.postMessageToSlack(slackWebhook, message);
} }
} }
run(); run();
/***/ }), /***/ }),
@ -172,31 +172,31 @@ run();
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) { /***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
"use strict"; "use strict";
var __importDefault = (this && this.__importDefault) || function (mod) { var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod }; return (mod && mod.__esModule) ? mod : { "default": mod };
}; };
Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.validateSemverVersionFromTag = exports.getMajorTagFromFullTag = exports.isStableSemverVersion = void 0; exports.validateSemverVersionFromTag = exports.getMajorTagFromFullTag = exports.isStableSemverVersion = void 0;
const parse_1 = __importDefault(__nccwpck_require__(5925)); const parse_1 = __importDefault(__nccwpck_require__(5925));
function isStableSemverVersion(version) { function isStableSemverVersion(version) {
return version.prerelease.length === 0; return version.prerelease.length === 0;
} }
exports.isStableSemverVersion = isStableSemverVersion; exports.isStableSemverVersion = isStableSemverVersion;
function getMajorTagFromFullTag(fullTag) { function getMajorTagFromFullTag(fullTag) {
return fullTag.split('.')[0]; return fullTag.split('.')[0];
} }
exports.getMajorTagFromFullTag = getMajorTagFromFullTag; exports.getMajorTagFromFullTag = getMajorTagFromFullTag;
function validateSemverVersionFromTag(tag) { function validateSemverVersionFromTag(tag) {
const semverVersion = parse_1.default(tag); const semverVersion = parse_1.default(tag);
if (!semverVersion) { if (!semverVersion) {
throw new Error(`The '${tag}' doesn't satisfy semantic versioning specification`); throw new Error(`The '${tag}' doesn't satisfy semantic versioning specification`);
} }
if (!isStableSemverVersion(semverVersion)) { if (!isStableSemverVersion(semverVersion)) {
throw new Error('It is not allowed to specify pre-release version to update the major tag'); throw new Error('It is not allowed to specify pre-release version to update the major tag');
} }
} }
exports.validateSemverVersionFromTag = validateSemverVersionFromTag; exports.validateSemverVersionFromTag = validateSemverVersionFromTag;
/***/ }), /***/ }),
@ -9327,7 +9327,7 @@ function onceStrict (fn) {
const debug = __nccwpck_require__(427) const debug = __nccwpck_require__(427)
const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(2293) const { MAX_LENGTH, MAX_SAFE_INTEGER } = __nccwpck_require__(2293)
const { re, t } = __nccwpck_require__(9523) const { safeRe: re, t } = __nccwpck_require__(9523)
const parseOptions = __nccwpck_require__(785) const parseOptions = __nccwpck_require__(785)
const { compareIdentifiers } = __nccwpck_require__(2463) const { compareIdentifiers } = __nccwpck_require__(2463)
@ -9343,7 +9343,7 @@ class SemVer {
version = version.version version = version.version
} }
} else if (typeof version !== 'string') { } else if (typeof version !== 'string') {
throw new TypeError(`Invalid Version: ${version}`) throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
} }
if (version.length > MAX_LENGTH) { if (version.length > MAX_LENGTH) {
@ -9502,36 +9502,36 @@ class SemVer {
// preminor will bump the version up to the next minor release, and immediately // preminor will bump the version up to the next minor release, and immediately
// down to pre-release. premajor and prepatch work the same way. // down to pre-release. premajor and prepatch work the same way.
inc (release, identifier) { inc (release, identifier, identifierBase) {
switch (release) { switch (release) {
case 'premajor': case 'premajor':
this.prerelease.length = 0 this.prerelease.length = 0
this.patch = 0 this.patch = 0
this.minor = 0 this.minor = 0
this.major++ this.major++
this.inc('pre', identifier) this.inc('pre', identifier, identifierBase)
break break
case 'preminor': case 'preminor':
this.prerelease.length = 0 this.prerelease.length = 0
this.patch = 0 this.patch = 0
this.minor++ this.minor++
this.inc('pre', identifier) this.inc('pre', identifier, identifierBase)
break break
case 'prepatch': case 'prepatch':
// If this is already a prerelease, it will bump to the next version // If this is already a prerelease, it will bump to the next version
// drop any prereleases that might already exist, since they are not // drop any prereleases that might already exist, since they are not
// relevant at this point. // relevant at this point.
this.prerelease.length = 0 this.prerelease.length = 0
this.inc('patch', identifier) this.inc('patch', identifier, identifierBase)
this.inc('pre', identifier) this.inc('pre', identifier, identifierBase)
break break
// If the input is a non-prerelease version, this acts the same as // If the input is a non-prerelease version, this acts the same as
// prepatch. // prepatch.
case 'prerelease': case 'prerelease':
if (this.prerelease.length === 0) { if (this.prerelease.length === 0) {
this.inc('patch', identifier) this.inc('patch', identifier, identifierBase)
} }
this.inc('pre', identifier) this.inc('pre', identifier, identifierBase)
break break
case 'major': case 'major':
@ -9573,9 +9573,15 @@ class SemVer {
break break
// This probably shouldn't be used publicly. // This probably shouldn't be used publicly.
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction. // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
case 'pre': case 'pre': {
const base = Number(identifierBase) ? 1 : 0
if (!identifier && identifierBase === false) {
throw new Error('invalid increment argument: identifier is empty')
}
if (this.prerelease.length === 0) { if (this.prerelease.length === 0) {
this.prerelease = [0] this.prerelease = [base]
} else { } else {
let i = this.prerelease.length let i = this.prerelease.length
while (--i >= 0) { while (--i >= 0) {
@ -9586,27 +9592,36 @@ class SemVer {
} }
if (i === -1) { if (i === -1) {
// didn't increment anything // didn't increment anything
this.prerelease.push(0) if (identifier === this.prerelease.join('.') && identifierBase === false) {
throw new Error('invalid increment argument: identifier already exists')
}
this.prerelease.push(base)
} }
} }
if (identifier) { if (identifier) {
// 1.2.0-beta.1 bumps to 1.2.0-beta.2, // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0 // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
let prerelease = [identifier, base]
if (identifierBase === false) {
prerelease = [identifier]
}
if (compareIdentifiers(this.prerelease[0], identifier) === 0) { if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
if (isNaN(this.prerelease[1])) { if (isNaN(this.prerelease[1])) {
this.prerelease = [identifier, 0] this.prerelease = prerelease
} }
} else { } else {
this.prerelease = [identifier, 0] this.prerelease = prerelease
} }
} }
break break
}
default: default:
throw new Error(`invalid increment argument: ${release}`) throw new Error(`invalid increment argument: ${release}`)
} }
this.format() this.raw = this.format()
this.raw = this.version if (this.build.length) {
this.raw += `+${this.build.join('.')}`
}
return this return this
} }
} }
@ -9619,35 +9634,18 @@ module.exports = SemVer
/***/ 5925: /***/ 5925:
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
const { MAX_LENGTH } = __nccwpck_require__(2293)
const { re, t } = __nccwpck_require__(9523)
const SemVer = __nccwpck_require__(8088) const SemVer = __nccwpck_require__(8088)
const parse = (version, options, throwErrors = false) => {
const parseOptions = __nccwpck_require__(785)
const parse = (version, options) => {
options = parseOptions(options)
if (version instanceof SemVer) { if (version instanceof SemVer) {
return version return version
} }
if (typeof version !== 'string') {
return null
}
if (version.length > MAX_LENGTH) {
return null
}
const r = options.loose ? re[t.LOOSE] : re[t.FULL]
if (!r.test(version)) {
return null
}
try { try {
return new SemVer(version, options) return new SemVer(version, options)
} catch (er) { } catch (er) {
return null if (!throwErrors) {
return null
}
throw er
} }
} }
@ -9670,11 +9668,29 @@ const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
// Max safe segment length for coercion. // Max safe segment length for coercion.
const MAX_SAFE_COMPONENT_LENGTH = 16 const MAX_SAFE_COMPONENT_LENGTH = 16
// Max safe length for a build identifier. The max length minus 6 characters for
// the shortest version with a build 0.0.0+BUILD.
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
const RELEASE_TYPES = [
'major',
'premajor',
'minor',
'preminor',
'patch',
'prepatch',
'prerelease',
]
module.exports = { module.exports = {
SEMVER_SPEC_VERSION,
MAX_LENGTH, MAX_LENGTH,
MAX_SAFE_INTEGER,
MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_COMPONENT_LENGTH,
MAX_SAFE_BUILD_LENGTH,
MAX_SAFE_INTEGER,
RELEASE_TYPES,
SEMVER_SPEC_VERSION,
FLAG_INCLUDE_PRERELEASE: 0b001,
FLAG_LOOSE: 0b010,
} }
@ -9729,16 +9745,20 @@ module.exports = {
/***/ 785: /***/ 785:
/***/ ((module) => { /***/ ((module) => {
// parse out just the options we care about so we always get a consistent // parse out just the options we care about
// obj with keys in a consistent order. const looseOption = Object.freeze({ loose: true })
const opts = ['includePrerelease', 'loose', 'rtl'] const emptyOpts = Object.freeze({ })
const parseOptions = options => const parseOptions = options => {
!options ? {} if (!options) {
: typeof options !== 'object' ? { loose: true } return emptyOpts
: opts.filter(k => options[k]).reduce((o, k) => { }
o[k] = true
return o if (typeof options !== 'object') {
}, {}) return looseOption
}
return options
}
module.exports = parseOptions module.exports = parseOptions
@ -9747,22 +9767,52 @@ module.exports = parseOptions
/***/ 9523: /***/ 9523:
/***/ ((module, exports, __nccwpck_require__) => { /***/ ((module, exports, __nccwpck_require__) => {
const { MAX_SAFE_COMPONENT_LENGTH } = __nccwpck_require__(2293) const {
MAX_SAFE_COMPONENT_LENGTH,
MAX_SAFE_BUILD_LENGTH,
MAX_LENGTH,
} = __nccwpck_require__(2293)
const debug = __nccwpck_require__(427) const debug = __nccwpck_require__(427)
exports = module.exports = {} exports = module.exports = {}
// The actual regexps go on exports.re // The actual regexps go on exports.re
const re = exports.re = [] const re = exports.re = []
const safeRe = exports.safeRe = []
const src = exports.src = [] const src = exports.src = []
const t = exports.t = {} const t = exports.t = {}
let R = 0 let R = 0
const LETTERDASHNUMBER = '[a-zA-Z0-9-]'
// Replace some greedy regex tokens to prevent regex dos issues. These regex are
// used internally via the safeRe object since all inputs in this library get
// normalized first to trim and collapse all extra whitespace. The original
// regexes are exported for userland consumption and lower level usage. A
// future breaking change could export the safer regex only with a note that
// all input should have extra whitespace removed.
const safeRegexReplacements = [
['\\s', 1],
['\\d', MAX_LENGTH],
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
]
const makeSafeRegex = (value) => {
for (const [token, max] of safeRegexReplacements) {
value = value
.split(`${token}*`).join(`${token}{0,${max}}`)
.split(`${token}+`).join(`${token}{1,${max}}`)
}
return value
}
const createToken = (name, value, isGlobal) => { const createToken = (name, value, isGlobal) => {
const safe = makeSafeRegex(value)
const index = R++ const index = R++
debug(name, index, value) debug(name, index, value)
t[name] = index t[name] = index
src[index] = value src[index] = value
re[index] = new RegExp(value, isGlobal ? 'g' : undefined) re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
} }
// The following Regular Expressions can be used for tokenizing, // The following Regular Expressions can be used for tokenizing,
@ -9772,13 +9822,13 @@ const createToken = (name, value, isGlobal) => {
// A single `0`, or a non-zero digit followed by zero or more digits. // A single `0`, or a non-zero digit followed by zero or more digits.
createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*') createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
createToken('NUMERICIDENTIFIERLOOSE', '[0-9]+') createToken('NUMERICIDENTIFIERLOOSE', '\\d+')
// ## Non-numeric Identifier // ## Non-numeric Identifier
// Zero or more digits, followed by a letter or hyphen, and then zero or // Zero or more digits, followed by a letter or hyphen, and then zero or
// more letters, digits, or hyphens. // more letters, digits, or hyphens.
createToken('NONNUMERICIDENTIFIER', '\\d*[a-zA-Z-][a-zA-Z0-9-]*') createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)
// ## Main Version // ## Main Version
// Three dot-separated numeric identifiers. // Three dot-separated numeric identifiers.
@ -9813,7 +9863,7 @@ createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
// ## Build Metadata Identifier // ## Build Metadata Identifier
// Any combination of digits, letters, or hyphens. // Any combination of digits, letters, or hyphens.
createToken('BUILDIDENTIFIER', '[0-9A-Za-z-]+') createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)
// ## Build Metadata // ## Build Metadata
// Plus sign, followed by one or more period-separated build metadata // Plus sign, followed by one or more period-separated build metadata

14
package-lock.json generated

@ -12,7 +12,7 @@
"@actions/core": "^1.2.7", "@actions/core": "^1.2.7",
"@actions/github": "^4.0.0", "@actions/github": "^4.0.0",
"@actions/http-client": "^1.0.11", "@actions/http-client": "^1.0.11",
"semver": "^7.3.5" "semver": "^7.5.2"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^27.0.2", "@types/jest": "^27.0.2",
@ -6598,9 +6598,9 @@
} }
}, },
"node_modules/semver": { "node_modules/semver": {
"version": "7.3.8", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"dependencies": { "dependencies": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
}, },
@ -12424,9 +12424,9 @@
} }
}, },
"semver": { "semver": {
"version": "7.3.8", "version": "7.5.4",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==", "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==",
"requires": { "requires": {
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
} }

@ -29,7 +29,7 @@
"@actions/core": "^1.2.7", "@actions/core": "^1.2.7",
"@actions/github": "^4.0.0", "@actions/github": "^4.0.0",
"@actions/http-client": "^1.0.11", "@actions/http-client": "^1.0.11",
"semver": "^7.3.5" "semver": "^7.5.2"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^27.0.2", "@types/jest": "^27.0.2",

Loading…
Cancel
Save