mirror of
https://github.com/pnpm/action-setup
synced 2026-11-08 13:27:56 +01:00
Add run_install input
This commit is contained in:
1 parent
4b13327683
commit
d44b8c5e53
6 files changed
+67
-1
No files matched your search
@@ -20,6 +20,10 @@ Install PNPM package manager.
|
||||
|
||||
**Optional** Registry to download PNPM from.
|
||||
|
||||
### `run_install`
|
||||
|
||||
**Optional** If specified, run `pnpm install`.
|
||||
|
||||
## Outputs
|
||||
|
||||
### `dest`
|
||||
|
||||
@@ -19,6 +19,10 @@ inputs:
|
||||
description: Registry to download PNPM from
|
||||
required: false
|
||||
default: https://registry.npmjs.com
|
||||
run_install:
|
||||
description: If specified, run `pnpm install`
|
||||
required: false
|
||||
default: 'null'
|
||||
runs:
|
||||
using: node12
|
||||
main: dist/index.js
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
module.exports=function(e,t){"use strict";var r={};function __webpack_require__(t){if(r[t]){return r[t].exports}var n=r[t]={i:t,l:false,exports:{}};e[t].call(n.exports,n,n.exports,__webpack_require__);n.l=true;return n.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(803)}return startup()}({0:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ref="301414cec74a2b6b63c95b42f2ad1790ccb980ed";t.url=`https://raw.githubusercontent.com/pnpm/self-installer/${t.ref}/install.js`;t.default=t.url},87:function(e){e.exports=require("os")},89:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n["throw"](e))}catch(e){o(e)}}function step(e){e.done?r(e.value):adopt(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(Object.hasOwnProperty.call(e,r))t[r]=e[r];t["default"]=e;return t};Object.defineProperty(t,"__esModule",{value:true});const s=r(486);const i=o(r(87));const u=o(r(622));var c;(function(e){e[e["Success"]=0]="Success";e[e["Failure"]=1]="Failure"})(c=t.ExitCode||(t.ExitCode={}));function exportVariable(e,t){const r=s.toCommandValue(t);process.env[e]=r;s.issueCommand("set-env",{name:e},r)}t.exportVariable=exportVariable;function setSecret(e){s.issueCommand("add-mask",{},e)}t.setSecret=setSecret;function addPath(e){s.issueCommand("add-path",{},e);process.env["PATH"]=`${e}${u.delimiter}${process.env["PATH"]}`}t.addPath=addPath;function getInput(e,t){const r=process.env[`INPUT_${e.replace(/ /g,"_").toUpperCase()}`]||"";if(t&&t.required&&!r){throw new Error(`Input required and not supplied: ${e}`)}return r.trim()}t.getInput=getInput;function setOutput(e,t){s.issueCommand("set-output",{name:e},t)}t.setOutput=setOutput;function setCommandEcho(e){s.issue("echo",e?"on":"off")}t.setCommandEcho=setCommandEcho;function setFailed(e){process.exitCode=c.Failure;error(e)}t.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}t.isDebug=isDebug;function debug(e){s.issueCommand("debug",{},e)}t.debug=debug;function error(e){s.issue("error",e instanceof Error?e.toString():e)}t.error=error;function warning(e){s.issue("warning",e instanceof Error?e.toString():e)}t.warning=warning;function info(e){process.stdout.write(e+i.EOL)}t.info=info;function startGroup(e){s.issue("group",e)}t.startGroup=startGroup;function endGroup(){s.issue("endgroup")}t.endGroup=endGroup;function group(e,t){return n(this,void 0,void 0,function*(){startGroup(e);let r;try{r=yield t()}finally{endGroup()}return r})}t.group=group;function saveState(e,t){s.issueCommand("save-state",{name:e},t)}t.saveState=saveState;function getState(e){return process.env[`STATE_${e}`]||""}t.getState=getState},129:function(e){e.exports=require("child_process")},191:function(e,t,r){"use strict";var n=r(87);if(typeof n.homedir!=="undefined"){e.exports=n.homedir}else{e.exports=r(394)}},203:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:true});function _interopDefault(e){return e&&typeof e==="object"&&"default"in e?e["default"]:e}var n=_interopDefault(r(413));var o=_interopDefault(r(605));var s=_interopDefault(r(835));var i=_interopDefault(r(211));var u=_interopDefault(r(761));const c=n.Readable;const l=Symbol("buffer");const f=Symbol("type");class Blob{constructor(){this[f]="";const e=arguments[0];const t=arguments[1];const r=[];let n=0;if(e){const t=e;const o=Number(t.length);for(let e=0;e<o;e++){const o=t[e];let s;if(o instanceof Buffer){s=o}else if(ArrayBuffer.isView(o)){s=Buffer.from(o.buffer,o.byteOffset,o.byteLength)}else if(o instanceof ArrayBuffer){s=Buffer.from(o)}else if(o instanceof Blob){s=o[l]}else{s=Buffer.from(typeof o==="string"?o:String(o))}n+=s.length;r.push(s)}}this[l]=Buffer.concat(r);let o=t&&t.type!==undefined&&String(t.type).toLowerCase();if(o&&!/[^\u0020-\u007E]/.test(o)){this[f]=o}}get size(){return this[l].length}get type(){return this[f]}text(){return Promise.resolve(this[l].toString())}arrayBuffer(){const e=this[l];const t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return Promise.resolve(t)}stream(){const e=new c;e._read=function(){};e.push(this[l]);e.push(null);return e}toString(){return"[object Blob]"}slice(){const e=this.size;const t=arguments[0];const r=arguments[1];let n,o;if(t===undefined){n=0}else if(t<0){n=Math.max(e+t,0)}else{n=Math.min(t,e)}if(r===undefined){o=e}else if(r<0){o=Math.max(e+r,0)}else{o=Math.min(r,e)}const s=Math.max(o-n,0);const i=this[l];const u=i.slice(n,n+s);const c=new Blob([],{type:arguments[2]});c[l]=u;return c}}Object.defineProperties(Blob.prototype,{size:{enumerable:true},type:{enumerable:true},slice:{enumerable:true}});Object.defineProperty(Blob.prototype,SyLine truncated
|
||||
module.exports=function(r,n){"use strict";var e={};function __webpack_require__(n){if(e[n]){return e[n].exports}var i=e[n]={i:n,l:false,exports:{}};r[n].call(i.exports,i,i.exports,__webpack_require__);i.l=true;return i.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(803)}return startup()}({0:function(r,n){"use strict";Object.defineProperty(n,"__esModule",{value:true});n.ref="301414cec74a2b6b63c95b42f2ad1790ccb980ed";n.url=`https://raw.githubusercontent.com/pnpm/self-installer/${n.ref}/install.js`;n.default=n.url},34:function(r){r.exports=require("https")},87:function(r){r.exports=require("os")},89:function(r,n,e){"use strict";var i=this&&this.__awaiter||function(r,n,e,i){function adopt(r){return r instanceof e?r:new e(function(n){n(r)})}return new(e||(e=Promise))(function(e,o){function fulfilled(r){try{step(i.next(r))}catch(r){o(r)}}function rejected(r){try{step(i["throw"](r))}catch(r){o(r)}}function step(r){r.done?e(r.value):adopt(r.value).then(fulfilled,rejected)}step((i=i.apply(r,n||[])).next())})};var o=this&&this.__importStar||function(r){if(r&&r.__esModule)return r;var n={};if(r!=null)for(var e in r)if(Object.hasOwnProperty.call(r,e))n[e]=r[e];n["default"]=r;return n};Object.defineProperty(n,"__esModule",{value:true});const u=e(486);const f=o(e(87));const t=o(e(622));var c;(function(r){r[r["Success"]=0]="Success";r[r["Failure"]=1]="Failure"})(c=n.ExitCode||(n.ExitCode={}));function exportVariable(r,n){const e=u.toCommandValue(n);process.env[r]=e;u.issueCommand("set-env",{name:r},e)}n.exportVariable=exportVariable;function setSecret(r){u.issueCommand("add-mask",{},r)}n.setSecret=setSecret;function addPath(r){u.issueCommand("add-path",{},r);process.env["PATH"]=`${r}${t.delimiter}${process.env["PATH"]}`}n.addPath=addPath;function getInput(r,n){const e=process.env[`INPUT_${r.replace(/ /g,"_").toUpperCase()}`]||"";if(n&&n.required&&!e){throw new Error(`Input required and not supplied: ${r}`)}return e.trim()}n.getInput=getInput;function setOutput(r,n){u.issueCommand("set-output",{name:r},n)}n.setOutput=setOutput;function setCommandEcho(r){u.issue("echo",r?"on":"off")}n.setCommandEcho=setCommandEcho;function setFailed(r){process.exitCode=c.Failure;error(r)}n.setFailed=setFailed;function isDebug(){return process.env["RUNNER_DEBUG"]==="1"}n.isDebug=isDebug;function debug(r){u.issueCommand("debug",{},r)}n.debug=debug;function error(r){u.issue("error",r instanceof Error?r.toString():r)}n.error=error;function warning(r){u.issue("warning",r instanceof Error?r.toString():r)}n.warning=warning;function info(r){process.stdout.write(r+f.EOL)}n.info=info;function startGroup(r){u.issue("group",r)}n.startGroup=startGroup;function endGroup(){u.issue("endgroup")}n.endGroup=endGroup;function group(r,n){return i(this,void 0,void 0,function*(){startGroup(r);let e;try{e=yield n()}finally{endGroup()}return e})}n.group=group;function saveState(r,n){u.issueCommand("save-state",{name:r},n)}n.saveState=saveState;function getState(r){return process.env[`STATE_${r}`]||""}n.getState=getState},90:function(r,n,e){"use strict";var i=e(205);function resolveJavascriptRegExp(r){if(r===null)return false;if(r.length===0)return false;var n=r,e=/\/([gim]*)$/.exec(r),i="";if(n[0]==="/"){if(e)i=e[1];if(i.length>3)return false;if(n[n.length-i.length-1]!=="/")return false}return true}function constructJavascriptRegExp(r){var n=r,e=/\/([gim]*)$/.exec(r),i="";if(n[0]==="/"){if(e)i=e[1];n=n.slice(1,n.length-i.length-1)}return new RegExp(n,i)}function representJavascriptRegExp(r){var n="/"+r.source+"/";if(r.global)n+="g";if(r.multiline)n+="m";if(r.ignoreCase)n+="i";return n}function isRegExp(r){return Object.prototype.toString.call(r)==="[object RegExp]"}r.exports=new i("tag:yaml.org,2002:js/regexp",{kind:"scalar",resolve:resolveJavascriptRegExp,construct:constructJavascriptRegExp,predicate:isRegExp,represent:representJavascriptRegExp})},129:function(r){r.exports=require("child_process")},147:function(r,n,e){"use strict";var i=e(205);r.exports=new i("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(r){return r!==null?r:[]}})},191:function(r,n,e){"use strict";var i=e(87);if(typeof i.homedir!=="undefined"){r.exports=i.homedir}else{r.exports=e(394)}},203:function(r,n,e){"use strict";Object.defineProperty(n,"__esModule",{value:true});function _interopDefault(r){return r&&typeof r==="object"&&"default"in r?r["default"]:r}var i=_interopDefault(e(413));var o=_interopDefault(e(605));var u=_interopDefault(e(835));var f=_interopDefault(e(34));var t=_interopDefault(e(761));const c=i.Readable;const s=Symbol("buffer");const l=Symbol("type");class Blob{constructor(){this[l]="";const r=arguments[0];const n=arguments[1];const e=[];let i=0;if(r){const n=r;const o=Number(n.length);for(let r=0;r<o;r++){const o=n[r];let u;if(o instanceof Buffer){u=o}else if(ArrayBuffer.isView(o)){u=Buffer.from(o.buffer,o.byteOffset,o.byteLength)}else if(o instanceof ArrayBuffer){u=Buffer.from(o)}else if(o instanceof Blob){u=o[s]}else{u=Line truncated
|
||||
@@ -8,9 +8,11 @@
|
||||
"dependencies": {
|
||||
"node-fetch": "^2.6.0",
|
||||
"expand-tilde": "^2.0.2",
|
||||
"js-yaml": "^3.13.1",
|
||||
"@actions/core": "^1.2.4",
|
||||
"@types/expand-tilde": "^2.0.0",
|
||||
"@types/node-fetch": "^2.5.7",
|
||||
"@types/js-yaml": "^3.12.3",
|
||||
"@types/node": "^13.13.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
Generated
+33
@@ -1,9 +1,11 @@
|
||||
dependencies:
|
||||
'@actions/core': 1.2.4
|
||||
'@types/expand-tilde': 2.0.0
|
||||
'@types/js-yaml': 3.12.3
|
||||
'@types/node': 13.13.5
|
||||
'@types/node-fetch': 2.5.7
|
||||
expand-tilde: 2.0.2
|
||||
js-yaml: 3.13.1
|
||||
node-fetch: 2.6.0
|
||||
devDependencies:
|
||||
'@zeit/ncc': 0.22.1
|
||||
@@ -18,6 +20,10 @@ packages:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-17h/6MRHoetV2QVUVnUfrmaFCXNIFJ3uDJmXlklX2xDtlEb1W0OXLgP+qwND2Ibg/PtQfQi0vx19KGuPayjLiw==
|
||||
/@types/js-yaml/3.12.3:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-otRe77JNNWzoVGLKw8TCspKswRoQToys4tuL6XYVBFxjgeM0RUrx7m3jkaTdxILxeGry3zM8mGYkGXMeQ02guA==
|
||||
/@types/node-fetch/2.5.7:
|
||||
dependencies:
|
||||
'@types/node': 13.13.5
|
||||
@@ -34,6 +40,12 @@ packages:
|
||||
hasBin: true
|
||||
resolution:
|
||||
integrity: sha512-Qq3bMuonkcnV/96jhy9SQYdh39NXHxNMJ1O31ZFzWG9n52fR2DLtgrNzhj/ahlEjnBziMLGVWDbaS9sf03/fEw==
|
||||
/argparse/1.0.10:
|
||||
dependencies:
|
||||
sprintf-js: 1.0.3
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
|
||||
/asynckit/0.4.0:
|
||||
dev: false
|
||||
resolution:
|
||||
@@ -52,6 +64,13 @@ packages:
|
||||
node: '>=0.4.0'
|
||||
resolution:
|
||||
integrity: sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
|
||||
/esprima/4.0.1:
|
||||
dev: false
|
||||
engines:
|
||||
node: '>=4'
|
||||
hasBin: true
|
||||
resolution:
|
||||
integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==
|
||||
/expand-tilde/2.0.2:
|
||||
dependencies:
|
||||
homedir-polyfill: 1.0.3
|
||||
@@ -78,6 +97,14 @@ packages:
|
||||
node: '>=0.10.0'
|
||||
resolution:
|
||||
integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==
|
||||
/js-yaml/3.13.1:
|
||||
dependencies:
|
||||
argparse: 1.0.10
|
||||
esprima: 4.0.1
|
||||
dev: false
|
||||
hasBin: true
|
||||
resolution:
|
||||
integrity: sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==
|
||||
/mime-db/1.44.0:
|
||||
dev: false
|
||||
engines:
|
||||
@@ -104,6 +131,10 @@ packages:
|
||||
node: '>=0.10.0'
|
||||
resolution:
|
||||
integrity: sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=
|
||||
/sprintf-js/1.0.3:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=
|
||||
/typescript/3.8.3:
|
||||
dev: true
|
||||
engines:
|
||||
@@ -114,9 +145,11 @@ packages:
|
||||
specifiers:
|
||||
'@actions/core': ^1.2.4
|
||||
'@types/expand-tilde': ^2.0.0
|
||||
'@types/js-yaml': ^3.12.3
|
||||
'@types/node': ^13.13.5
|
||||
'@types/node-fetch': ^2.5.7
|
||||
'@zeit/ncc': ^0.22.1
|
||||
expand-tilde: ^2.0.2
|
||||
js-yaml: ^3.13.1
|
||||
node-fetch: ^2.6.0
|
||||
typescript: ^3.8.3
|
||||
@@ -1,11 +1,25 @@
|
||||
import { getInput, InputOptions } from '@actions/core'
|
||||
import expandTilde from 'expand-tilde'
|
||||
import { safeLoad } from 'js-yaml'
|
||||
|
||||
interface RunInstall {
|
||||
readonly recursive?: boolean
|
||||
readonly cwd?: string
|
||||
readonly args?: readonly string[]
|
||||
}
|
||||
|
||||
type RunInstallInput =
|
||||
| null
|
||||
| boolean
|
||||
| RunInstall
|
||||
| RunInstall[]
|
||||
|
||||
export interface Inputs {
|
||||
readonly version: string
|
||||
readonly dest: string
|
||||
readonly binDest: string
|
||||
readonly registry: string
|
||||
readonly runInstall: RunInstall[]
|
||||
}
|
||||
|
||||
const options: InputOptions = {
|
||||
@@ -14,11 +28,20 @@ const options: InputOptions = {
|
||||
|
||||
const parseInputPath = (name: string) => expandTilde(getInput(name, options))
|
||||
|
||||
function parseRunInstall(name: string): RunInstall[] {
|
||||
const result: RunInstallInput = safeLoad(getInput(name, options))
|
||||
if (!result) return []
|
||||
if (result === true) return [{ recursive: true }]
|
||||
if (Array.isArray(result)) return result
|
||||
return [result]
|
||||
}
|
||||
|
||||
export const getInputs = (): Inputs => ({
|
||||
version: getInput('version', options),
|
||||
dest: parseInputPath('dest'),
|
||||
binDest: parseInputPath('bin_dest'),
|
||||
registry: getInput('registry', options),
|
||||
runInstall: parseRunInstall('run_install'),
|
||||
})
|
||||
|
||||
export default getInputs
|
||||
Reference in new issue
Block a user