cargo-semver-checks/dist/index.js

21 lines
1.6 MiB
JavaScript
Raw Normal View History

(()=>{var __webpack_modules__={2544:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))i(t,e,r);s(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.annotate=t.escapeProperty=t.escapeData=void 0;const n=a(r(2037));function toCommandValue(e){if(e===null||e===undefined){return""}else if(typeof e==="string"||e instanceof String){return e}return JSON.stringify(e)}function escapeData(e){return toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}t.escapeData=escapeData;function escapeProperty(e){return toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}t.escapeProperty=escapeProperty;const o="::";function render(e,t,r){let i=o+e;if(r&&Object.keys(r).length>0){i+=" ";let e=true;for(const[t,s]of Object.entries(r)){if(s){if(e){e=false}else{i+=","}i+=`${t}=${escapeProperty(s)}`}}}i+=`${o}${escapeData(t)}`;return i}function annotate(e){let t;switch(e.annotation_level){case"notice":case"warning":t="warning";break;case"failure":t="error";break}const r=render(t,e.message,{file:e.path,line:e.start_line,col:e.start_column});process.stdout.write(r+n.EOL)}t.annotate=annotate},6014:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))i(t,e,r);s(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.CheckReporter=void 0;const n=a(r(3706));class CheckReporter{constructor(e,t){this.client=e;this.checkName=t;this.checkId=undefined}async startCheck(e){const{owner:t,repo:r}=n.context.repo;const i=await this.client.checks.create({owner:t,repo:r,name:this.checkName,head_sha:n.context.sha,status:e?e:"in_progress"});this.checkId=i.data.id;return this.checkId}async finishCheck(e,t){const{owner:r,repo:i}=n.context.repo;await this.client.checks.update({owner:r,repo:i,name:this.checkName,check_run_id:this.checkId,status:"completed",conclusion:e,completed_at:(new Date).toISOString(),output:t});return}async cancelCheck(){const{owner:e,repo:t}=n.context.repo;await this.client.checks.update({owner:e,repo:t,name:this.checkName,check_run_id:this.checkId,status:"completed",conclusion:"cancelled",completed_at:(new Date).toISOString(),output:{title:this.checkName,summary:"Unhandled error",text:"Check was cancelled due to unhandled error. Check the Action logs for details."}});return}}t.CheckReporter=CheckReporter},9438:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))i(t,e,r);s(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.Cargo=t.resolveVersion=void 0;const n=a(r(7436));const o=a(r(2186));const p
2023-01-09 00:46:08 +01:00
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function isPlainObject(e){var t,r;if(isObject(e)===false)return false;t=e.constructor;if(t===undefined)return true;r=t.prototype;if(isObject(r)===false)return false;if(r.hasOwnProperty("isPrototypeOf")===false){return false}return true}t.isPlainObject=isPlainObject},7426:(e,t,r)=>{
2023-01-09 00:46:08 +01:00
/*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*/
e.exports=r(3765)},3583:(e,t,r)=>{"use strict";
2023-01-09 00:46:08 +01:00
/*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/var i=r(7426);var s=r(1017).extname;var a=/^\s*([^;\s]*)(?:;|\s|$)/;var n=/^text\//i;t.charset=charset;t.charsets={lookup:charset};t.contentType=contentType;t.extension=extension;t.extensions=Object.create(null);t.lookup=lookup;t.types=Object.create(null);populateMaps(t.extensions,t.types);function charset(e){if(!e||typeof e!=="string"){return false}var t=a.exec(e);var r=t&&i[t[1].toLowerCase()];if(r&&r.charset){return r.charset}if(t&&n.test(t[1])){return"UTF-8"}return false}function contentType(e){if(!e||typeof e!=="string"){return false}var r=e.indexOf("/")===-1?t.lookup(e):e;if(!r){return false}if(r.indexOf("charset")===-1){var i=t.charset(r);if(i)r+="; charset="+i.toLowerCase()}return r}function extension(e){if(!e||typeof e!=="string"){return false}var r=a.exec(e);var i=r&&t.extensions[r[1].toLowerCase()];if(!i||!i.length){return false}return i[0]}function lookup(e){if(!e||typeof e!=="string"){return false}var r=s("x."+e).toLowerCase().substr(1);if(!r){return false}return t.types[r]||false}function populateMaps(e,t){var r=["nginx","apache",undefined,"iana"];Object.keys(i).forEach((function forEachMimeType(s){var a=i[s];var n=a.extensions;if(!n||!n.length){return}e[s]=n;for(var o=0;o<n.length;o++){var p=n[o];if(t[p]){var l=r.indexOf(i[t[p]].source);var c=r.indexOf(a.source);if(t[p]!=="application/octet-stream"&&(l>c||l===c&&t[p].substr(0,12)==="application/")){continue}}t[p]=s}}))}},3973:(e,t,r)=>{e.exports=minimatch;minimatch.Minimatch=Minimatch;var i=function(){try{return r(1017)}catch(e){}}()||{sep:"/"};minimatch.sep=i.sep;var s=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var a=r(3717);var n={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var o="[^/]";var p=o+"*?";var l="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var c="(?:(?!(?:\\/|^)\\.).)*?";var d=charSet("().*{}+?[]^$\\!");function charSet(e){return e.split("").reduce((function(e,t){e[t]=true;return e}),{})}var u=/\/+/;minimatch.filter=filter;function filter(e,t){t=t||{};return function(r,i,s){return minimatch(r,e,t)}}function ext(e,t){t=t||{};var r={};Object.keys(e).forEach((function(t){r[t]=e[t]}));Object.keys(t).forEach((function(e){r[e]=t[e]}));return r}minimatch.defaults=function(e){if(!e||typeof e!=="object"||!Object.keys(e).length){return minimatch}var t=minimatch;var r=function minimatch(r,i,s){return t(r,i,ext(e,s))};r.Minimatch=function Minimatch(r,i){return new t.Minimatch(r,ext(e,i))};r.Minimatch.defaults=function defaults(r){return t.defaults(ext(e,r)).Minimatch};r.filter=function filter(r,i){return t.filter(r,ext(e,i))};r.defaults=function defaults(r){return t.defaults(ext(e,r))};r.makeRe=function makeRe(r,i){return t.makeRe(r,ext(e,i))};r.braceExpand=function braceExpand(r,i){return t.braceExpand(r,ext(e,i))};r.match=function(r,i,s){return t.match(r,i,ext(e,s))};return r};Minimatch.defaults=function(e){return minimatch.defaults(e).Minimatch};function minimatch(e,t,r){assertValidPattern(t);if(!r)r={};if(!r.nocomment&&t.charAt(0)==="#"){return false}return new Minimatch(t,r).match(e)}function Minimatch(e,t){if(!(this instanceof Minimatch)){return new Minimatch(e,t)}assertValidPattern(e);if(!t)t={};e=e.trim();if(!t.allowWindowsEscape&&i.sep!=="/"){e=e.split(i.sep).join("/")}this.options=t;this.set=[];this.pattern=e;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!t.partial;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){var e=this.pattern;var t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate();var r=this.globSet=this.braceExpand();if(t.debug)this.debug=function debug(){console.error.apply(console,arguments)};this.debug(this.pattern,r);r=this.globParts=r.map((function(e){return e.split(u)}));this.debug(this.pattern,r);r=r.map((function(e,t,r){return e.map(this.parse,this)}),this);this.debug(this.pattern,r);r=r.filter((function(e){return e.indexOf(false)===-1}));this.debug(this.pattern,r);thi
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var e=String.fromCharCode;var t=Math.floor;var fromCodePoint=function(){var r=16384;var i=[];var s;var a;var n=-1;var o=arguments.length;if(!o){return""}var p="";while(++n<o){var l=Number(arguments[n]);if(!isFinite(l)||l<0||l>1114111||t(l)!==l){throw RangeError("Invalid code point: "+l)}if(l<=65535){i.push(l)}else{l-=65536;s=(l>>10)+55296;a=l%1024+56320;i.push(s,a)}if(n+1===o||i.length>r){p+=e.apply(null,i);i.length=0}}return p};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:t)},5911:(e,t)=>{t=e.exports=SemVer;var r;if(typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)){r=function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER");console.log.apply(console,e)}}else{r=function(){}}t.SEMVER_SPEC_VERSION="2.0.0";var i=256;var s=Number.MAX_SAFE_INTEGER||9007199254740991;var a=16;var n=i-6;var o=t.re=[];var p=t.safeRe=[];var l=t.src=[];var c=t.tokens={};var d=0;function tok(e){c[e]=d++}var u="[a-zA-Z0-9-]";var h=[["\\s",1],["\\d",i],[u,n]];function makeSafeRe(e){for(var t=0;t<h.length;t++){var r=h[t][0];var i=h[t][1];e=e.split(r+"*").join(r+"{0,"+i+"}").split(r+"+").join(r+"{1,"+i+"}")}return e}tok("NUMERICIDENTIFIER");l[c.NUMERICIDENTIFIER]="0|[1-9]\\d*";tok("NUMERICIDENTIFIERLOOSE");l[c.NUMERICIDENTIFIERLOOSE]="\\d+";tok("NONNUMERICIDENTIFIER");l[c.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+u+"*";tok("MAINVERSION");l[c.MAINVERSION]="("+l[c.NUMERICIDENTIFIER]+")\\."+"("+l[c.NUMERICIDENTIFIER]+")\\."+"("+l[c.NUMERICIDENTIFIER]+")";tok("MAINVERSIONLOOSE");l[c.MAINVERSIONLOOSE]="("+l[c.NUMERICIDENTIFIERLOOSE]+")\\."+"("+l[c.NUMERICIDENTIFIERLOOSE]+")\\."+"("+l[c.NUMERICIDENTIFIERLOOSE]+")";tok("PRERELEASEIDENTIFIER");l[c.PRERELEASEIDENTIFIER]="(?:"+l[c.NUMERICIDENTIFIER]+"|"+l[c.NONNUMERICIDENTIFIER]+")";tok("PRERELEASEIDENTIFIERLOOSE");l[c.PRERELEASEIDENTIFIERLOOSE]="(?:"+l[c.NUMERICIDENTIFIERLOOSE]+"|"+l[c.NONNUMERICIDENTIFIER]+")";tok("PRERELEASE");l[c.PRERELEASE]="(?:-("+l[c.PRERELEASEIDENTIFIER]+"(?:\\."+l[c.PRERELEASEIDENTIFIER]+")*))";tok("PRERELEASELOOSE");l[c.PRERELEASELOOSE]="(?:-?("+l[c.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+l[c.PRERELEASEIDENTIFIERLOOSE]+")*))";tok("BUILDIDENTIFIER");l[c.BUILDIDENTIFIER]=u+"+";tok("BUILD");l[c.BUILD]="(?:\\+("+l[c.BUILDIDENTIFIER]+"(?:\\."+l[c.BUILDIDENTIFIER]+")*))";tok("FULL");tok("FULLPLAIN");l[c.FULLPLAIN]="v?"+l[c.MAINVERSION]+l[c.PRERELEASE]+"?"+l[c.BUILD]+"?";l[c.FULL]="^"+l[c.FULLPLAIN]+"$";tok("LOOSEPLAIN");l[c.LOOSEPLAIN]="[v=\\s]*"+l[c.MAINVERSIONLOOSE]+l[c.PRERELEASELOOSE]+"?"+l[c.BUILD]+"?";tok("LOOSE");l[c.LOOSE]="^"+l[c.LOOSEPLAIN]+"$";tok("GTLT");l[c.GTLT]="((?:<|>)?=?)";tok("XRANGEIDENTIFIERLOOSE");l[c.XRANGEIDENTIFIERLOOSE]=l[c.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";tok("XRANGEIDENTIFIER");l[c.XRANGEIDENTIFIER]=l[c.NUMERICIDENTIFIER]+"|x|X|\\*";tok("XRANGEPLAIN");l[c.XRANGEPLAIN]="[v=\\s]*("+l[c.XRANGEIDENTIFIER]+")"+"(?:\\.("+l[c.XRANGEIDENTIFIER]+")"+"(?:\\.("+l[c.XRANGEIDENTIFIER]+")"+"(?:"+l[c.PRERELEASE]+")?"+l[c.BUILD]+"?"+")?)?";tok("XRANGEPLAINLOOSE");l[c.XRANGEPLAINLOOSE]="[v=\\s]*("+l[c.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+l[c.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+l[c.XRANGEIDENTIFIERLOOSE]+")"+"(?:"+l[c.PRERELEASELOOSE]+")?"+l[c.BUILD]+"?"+")?)?";tok("XRANGE");l[c.XRANGE]="^"+l[c.GTLT]+"\\s*"+l[c.XRANGEPLAIN]+"$";tok("XRANGELOOSE");l[c.XRANGELOOSE]="^"+l[c.GTLT]+"\\s*"+l[c.XRANGEPLAINLOOSE]+"$";tok("COERCE");l[c.COERCE]="(^|[^\\d])"+"(\\d{1,"+a+"})"+"(?:\\.(\\d{1,"+a+"}))?"+"(?:\\.(\\d{1,"+a+"}))?"+"(?:$|[^\\d])";tok("COERCERTL");o[c.COERCERTL]=new RegExp(l[c.COERCE],"g");p[c.COERCERTL]=new RegExp(makeSafeRe(l[c.COERCE]),"g");tok("LONETILDE");l[c.LONETILDE]="(?:~>?)";tok("TILDETRIM");l[c.TILDETRIM]="(\\s*)"+l[c.LONETILDE]+"\\s+";o[c.TILDETRIM]=new RegExp(l[c.TILDETRIM],"g");p[c.TILDETRIM]=new RegExp(makeSafeRe(l[c.TILDETRIM]),"g");var g="$1~";tok("TILDE");l[c.TILDE]="^"+l