Release from master

This commit is contained in:
Danny McCormick 2019-08-21 22:58:23 -04:00
parent 5273d0df9c
commit 8de2f9fcbc
34 changed files with 371 additions and 293 deletions

View File

@ -1,5 +1,9 @@
# setup-node # setup-node
<p align="left">
<a href="https://github.com/actions/setup-node"><img alt="GitHub Actions status" src="https://github.com/actions/setup-node/workflows/Main%20workflow/badge.svg"></a>
</p>
This action sets by node environment for use in actions by: This action sets by node environment for use in actions by:
- optionally downloading and caching a version of node - npm by version spec and add to PATH - optionally downloading and caching a version of node - npm by version spec and add to PATH
@ -15,7 +19,7 @@ steps:
- uses: actions/checkout@master - uses: actions/checkout@master
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
version: '10.x' node-version: '10.x'
- run: npm install - run: npm install
- run: npm test - run: npm test
``` ```
@ -34,7 +38,7 @@ jobs:
- name: Setup node - name: Setup node
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
version: ${{ matrix.node }} node-version: ${{ matrix.node }}
- run: npm install - run: npm install
- run: npm test - run: npm test
``` ```
@ -45,7 +49,7 @@ steps:
- uses: actions/checkout@master - uses: actions/checkout@master
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
version: '10.x' node-version: '10.x'
registry-url: 'https://registry.npmjs.org' registry-url: 'https://registry.npmjs.org'
- run: npm install - run: npm install
- run: npm publish - run: npm publish
@ -65,7 +69,7 @@ steps:
- uses: actions/checkout@master - uses: actions/checkout@master
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
version: '10.x' node-version: '10.x'
registry-url: <registry url> registry-url: <registry url>
- run: npm install -g yarn - run: npm install -g yarn
- run: yarn install - run: yarn install

View File

@ -7,12 +7,12 @@ registry=https://registry.npmjs.org/"
exports[`installer tests Automatically configures GPR scope 1`] = ` exports[`installer tests Automatically configures GPR scope 1`] = `
"npm.pkg.github.com/:_authToken=\${NODE_AUTH_TOKEN} "npm.pkg.github.com/:_authToken=\${NODE_AUTH_TOKEN}
@owner:registry=npm.pkg.github.com/" @ownername:registry=npm.pkg.github.com/"
`; `;
exports[`installer tests Configures scoped npm registries 1`] = ` exports[`installer tests Configures scoped npm registries 1`] = `
"//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN} "//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}
@myScope:registry=https://registry.npmjs.org/" @myscope:registry=https://registry.npmjs.org/"
`; `;
exports[`installer tests Sets up npmrc for npmjs 1`] = ` exports[`installer tests Sets up npmrc for npmjs 1`] = `

View File

@ -15,7 +15,7 @@ const tempDir = path.join(
const rcFile = path.join(tempDir, '.npmrc'); const rcFile = path.join(tempDir, '.npmrc');
process.env['GITHUB_REPOSITORY'] = 'owner/repo'; process.env['GITHUB_REPOSITORY'] = 'OwnerName/repo';
process.env['RUNNER_TEMP'] = tempDir; process.env['RUNNER_TEMP'] = tempDir;
import * as auth from '../src/authutil'; import * as auth from '../src/authutil';

View File

@ -1,14 +1,17 @@
name: 'Setup Node.js for use with actions' name: 'Setup Node.js environment'
description: 'Setup a Node.js environment and add it to the PATH, additionally providing proxy support' description: 'Setup a Node.js environment and add it to the PATH, additionally providing proxy support'
author: 'GitHub' author: 'GitHub'
inputs: inputs:
version: node-version:
description: 'Version Spec of the version to use. Examples: 10.x, 10.15.1, >=10.15.0, lts' description: 'Version Spec of the version to use. Examples: 10.x, 10.15.1, >=10.15.0'
default: '10.x' default: '10.x'
registry-url: registry-url:
description: 'Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN' description: 'Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN'
scope: scope:
description: 'Optional scope for authenticating against scoped registries' description: 'Optional scope for authenticating against scoped registries'
# Deprecated option, do not use. Will not be supported after October 1, 2019
version:
description: 'Deprecated. Use node-version instead. Will not be supported after October 1, 2019'
runs: runs:
using: 'node12' using: 'node12'
main: 'lib/setup-node.js' main: 'lib/setup-node.js'

View File

@ -28,6 +28,9 @@ function writeRegistryToFile(registryUrl, fileLocation) {
if (scope && scope[0] != '@') { if (scope && scope[0] != '@') {
scope = '@' + scope; scope = '@' + scope;
} }
if (scope) {
scope = scope.toLowerCase();
}
core.debug(`Setting auth in ${fileLocation}`); core.debug(`Setting auth in ${fileLocation}`);
let newContents = ''; let newContents = '';
if (fs.existsSync(fileLocation)) { if (fs.existsSync(fileLocation)) {

View File

@ -103,7 +103,7 @@ function queryLatestMatch(versionSpec) {
} }
let versions = []; let versions = [];
let dataUrl = 'https://nodejs.org/dist/index.json'; let dataUrl = 'https://nodejs.org/dist/index.json';
let rest = new restm.RestClient('vsts-node-tool'); let rest = new restm.RestClient('setup-node');
let nodeVersions = (yield rest.get(dataUrl)).result || []; let nodeVersions = (yield rest.get(dataUrl)).result || [];
nodeVersions.forEach((nodeVersion) => { nodeVersions.forEach((nodeVersion) => {
// ensure this version supports your os and platform // ensure this version supports your os and platform

View File

@ -26,7 +26,10 @@ function run() {
// Version is optional. If supplied, install / use from the tool cache // Version is optional. If supplied, install / use from the tool cache
// If not supplied then task is still used to setup proxy, auth, etc... // If not supplied then task is still used to setup proxy, auth, etc...
// //
const version = core.getInput('version'); let version = core.getInput('version');
if (!version) {
version = core.getInput('node-version');
}
if (version) { if (version) {
// TODO: installer doesn't support proxy // TODO: installer doesn't support proxy
yield installer.getNode(version); yield installer.getNode(version);

76
node_modules/@actions/core/README.md generated vendored
View File

@ -4,4 +4,78 @@
## Usage ## Usage
See [src/core.ts](src/core.ts). #### Inputs/Outputs
You can use this library to get inputs or set outputs:
```
const core = require('@actions/core');
const myInput = core.getInput('inputName', { required: true });
// Do stuff
core.setOutput('outputKey', 'outputVal');
```
#### Exporting variables/secrets
You can also export variables and secrets for future steps. Variables get set in the environment automatically, while secrets must be scoped into the environment from a workflow using `{{ secret.FOO }}`. Secrets will also be masked from the logs:
```
const core = require('@actions/core');
// Do stuff
core.exportVariable('envVar', 'Val');
core.exportSecret('secretVar', variableWithSecretValue);
```
#### PATH Manipulation
You can explicitly add items to the path for all remaining steps in a workflow:
```
const core = require('@actions/core');
core.addPath('pathToTool');
```
#### Exit codes
You should use this library to set the failing exit code for your action:
```
const core = require('@actions/core');
try {
// Do stuff
}
catch (err) {
// setFailed logs the message and sets a failing exit code
core.setFailed(`Action failed with error ${err}`);
}
```
#### Logging
Finally, this library provides some utilities for logging:
```
const core = require('@actions/core');
const myInput = core.getInput('input');
try {
core.debug('Inside try block');
if (!myInput) {
core.warning('myInput wasnt set');
}
// Do stuff
}
catch (err) {
core.error('Error ${err}, action may still succeed though');
}
```

View File

@ -5,6 +5,19 @@ export interface InputOptions {
/** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */ /** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */
required?: boolean; required?: boolean;
} }
/**
* The code to exit an action
*/
export declare enum ExitCode {
/**
* A code indicating that the action was successful
*/
Success = 0,
/**
* A code indicating that the action was a failure
*/
Failure = 1
}
/** /**
* sets env variable for this action and future actions in the job * sets env variable for this action and future actions in the job
* @param name the name of the variable to set * @param name the name of the variable to set
@ -31,9 +44,12 @@ export declare function addPath(inputPath: string): void;
*/ */
export declare function getInput(name: string, options?: InputOptions): string; export declare function getInput(name: string, options?: InputOptions): string;
/** /**
* Sets the action status to neutral * Sets the value of an output.
*
* @param name name of the output to set
* @param value value to store
*/ */
export declare function setNeutral(): void; export declare function setOutput(name: string, value: string): void;
/** /**
* Sets the action status to failed. * Sets the action status to failed.
* When the action exits it will be with an exit code of 1 * When the action exits it will be with an exit code of 1

View File

@ -1,8 +1,21 @@
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
const exit_1 = require("@actions/exit");
const command_1 = require("./command"); const command_1 = require("./command");
const path = require("path"); const path = require("path");
/**
* The code to exit an action
*/
var ExitCode;
(function (ExitCode) {
/**
* A code indicating that the action was successful
*/
ExitCode[ExitCode["Success"] = 0] = "Success";
/**
* A code indicating that the action was a failure
*/
ExitCode[ExitCode["Failure"] = 1] = "Failure";
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// Variables // Variables
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
@ -50,23 +63,26 @@ function getInput(name, options) {
return val.trim(); return val.trim();
} }
exports.getInput = getInput; exports.getInput = getInput;
/**
* Sets the value of an output.
*
* @param name name of the output to set
* @param value value to store
*/
function setOutput(name, value) {
command_1.issueCommand('set-output', { name }, value);
}
exports.setOutput = setOutput;
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
// Results // Results
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
/**
* Sets the action status to neutral
*/
function setNeutral() {
process.exitCode = exit_1.ExitCode.Neutral;
}
exports.setNeutral = setNeutral;
/** /**
* Sets the action status to failed. * Sets the action status to failed.
* When the action exits it will be with an exit code of 1 * When the action exits it will be with an exit code of 1
* @param message add error issue message * @param message add error issue message
*/ */
function setFailed(message) { function setFailed(message) {
process.exitCode = exit_1.ExitCode.Failure; process.exitCode = ExitCode.Failure;
error(message); error(message);
} }
exports.setFailed = setFailed; exports.setFailed = setFailed;

View File

@ -1 +1 @@
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;AAAA,wCAAsC;AACtC,uCAA6C;AAE7C,6BAA4B;AAU5B,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAW;IACtD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACvB,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,GAAG,CAAC,CAAA;AACtC,CAAC;AAHD,wCAGC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,IAAY,EAAE,GAAW;IACpD,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IACzB,sBAAY,CAAC,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.0.tgz", "_from": "@actions/core@^1.0.0",
"_id": "@actions/core@0.0.0", "_id": "@actions/core@1.0.0",
"_inBundle": false, "_inBundle": false,
"_integrity": "sha512-58ituSV1rzBMmmsWoFDnrnsT+Wm4kD/u9NgAGbPvZ7rQHWluYtD5bDbIsjDC6rKFuhqytkxDJPsF/TWBdgc/nA==", "_integrity": "sha512-aMIlkx96XH4E/2YZtEOeyrYQfhlas9jIRkfGPqMwXD095Rdkzo4lB6ZmbxPQSzD+e1M+Xsm98ZhuSMYGv/AlqA==",
"_location": "/@actions/core", "_location": "/@actions/core",
"_phantomChildren": {}, "_phantomChildren": {},
"_requested": { "_requested": {
"type": "file", "type": "range",
"where": "C:\\Users\\Administrator\\Documents\\setup-node", "registry": true,
"raw": "@actions/core@file:toolkit/actions-core-0.0.0.tgz", "raw": "@actions/core@^1.0.0",
"name": "@actions/core", "name": "@actions/core",
"escapedName": "@actions%2fcore", "escapedName": "@actions%2fcore",
"scope": "@actions", "scope": "@actions",
"rawSpec": "file:toolkit/actions-core-0.0.0.tgz", "rawSpec": "^1.0.0",
"saveSpec": "file:toolkit\\actions-core-0.0.0.tgz", "saveSpec": null,
"fetchSpec": "C:\\Users\\Administrator\\Documents\\setup-node\\toolkit\\actions-core-0.0.0.tgz" "fetchSpec": "^1.0.0"
}, },
"_requiredBy": [ "_requiredBy": [
"/", "/",
"/@actions/tool-cache" "/@actions/tool-cache"
], ],
"_resolved": "C:\\Users\\Administrator\\Documents\\setup-node\\toolkit\\actions-core-0.0.0.tgz", "_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.0.0.tgz",
"_shasum": "346d90a534fa6c5021bc2e1b732574fd2c66fc35", "_shasum": "4a090a2e958cc300b9ea802331034d5faf42d239",
"_spec": "@actions/core@file:toolkit/actions-core-0.0.0.tgz", "_spec": "@actions/core@^1.0.0",
"_where": "C:\\Users\\Administrator\\Documents\\setup-node", "_where": "C:\\Users\\damccorm\\Documents\\setup-node",
"bugs": { "bugs": {
"url": "https://github.com/actions/toolkit/issues" "url": "https://github.com/actions/toolkit/issues"
}, },
"bundleDependencies": false, "bundleDependencies": false,
"dependencies": {
"@actions/exit": "^0.0.0"
},
"deprecated": false, "deprecated": false,
"description": "Actions core lib", "description": "Actions core lib",
"devDependencies": { "devDependencies": {
@ -43,6 +40,7 @@
"files": [ "files": [
"lib" "lib"
], ],
"gitHead": "a40bce7c8d382aa3dbadaa327acbc696e9390e55",
"homepage": "https://github.com/actions/toolkit/tree/master/packages/core", "homepage": "https://github.com/actions/toolkit/tree/master/packages/core",
"keywords": [ "keywords": [
"core", "core",
@ -62,5 +60,5 @@
"test": "echo \"Error: run tests from root\" && exit 1", "test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc" "tsc": "tsc"
}, },
"version": "0.0.0" "version": "1.0.0"
} }

7
node_modules/@actions/exec/LICENSE.md generated vendored Normal file
View File

@ -0,0 +1,7 @@
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

59
node_modules/@actions/exec/README.md generated vendored
View File

@ -1,7 +1,60 @@
# `@actions/exec` # `@actions/exec`
> Functions necessary for running tools on the command line
## Usage ## Usage
See [src/exec.ts](src/exec.ts). #### Basic
You can use this package to execute your tools on the command line in a cross platform way:
```
const exec = require('@actions/exec');
await exec.exec('node index.js');
```
#### Args
You can also pass in arg arrays:
```
const exec = require('@actions/exec');
await exec.exec('node', ['index.js', 'foo=bar']);
```
#### Output/options
Capture output or specify [other options](https://github.com/actions/toolkit/blob/d9347d4ab99fd507c0b9104b2cf79fb44fcc827d/packages/exec/src/interfaces.ts#L5):
```
const exec = require('@actions/exec');
const myOutput = '';
const myError = '';
const options = {};
options.listeners = {
stdout: (data: Buffer) => {
myOutput += data.toString();
},
stderr: (data: Buffer) => {
myError += data.toString();
}
};
options.cwd = './lib';
await exec.exec('node', ['index.js', 'foo=bar'], options);
```
#### Exec tools not in the PATH
You can use it in conjunction with the `which` function from `@actions/io` to execute tools that are not in the PATH:
```
const exec = require('@actions/exec');
const io = require('@actions/io');
const pythonPath: string = await io.which('python', true)
await exec.exec(`"${pythonPath}"`, ['main.py']);
```

View File

@ -1,29 +1,28 @@
{ {
"_from": "file:toolkit\\actions-exec-0.0.0.tgz", "_from": "@actions/exec@^1.0.0",
"_id": "@actions/exec@0.0.0", "_id": "@actions/exec@1.0.0",
"_inBundle": false, "_inBundle": false,
"_integrity": "sha512-HHObusC4p1RElxIlrrN0sY/cweBYl+jKm3J/XWHPQZMipgJXB/dkVhUfl4KqH3Vim7oM2KjCGSfn+vTYrqVH3A==", "_integrity": "sha512-nquH0+XKng+Ll7rZfCojN7NWSbnGh+ltwUJhzfbLkmOJgxocGX2/yXcZLMyT9fa7+tByEow/NSTrBExNlEj9fw==",
"_location": "/@actions/exec", "_location": "/@actions/exec",
"_phantomChildren": {}, "_phantomChildren": {},
"_requested": { "_requested": {
"type": "file", "type": "range",
"where": "C:\\Users\\Administrator\\Documents\\setup-node", "registry": true,
"raw": "@actions/exec@file:toolkit/actions-exec-0.0.0.tgz", "raw": "@actions/exec@^1.0.0",
"name": "@actions/exec", "name": "@actions/exec",
"escapedName": "@actions%2fexec", "escapedName": "@actions%2fexec",
"scope": "@actions", "scope": "@actions",
"rawSpec": "file:toolkit/actions-exec-0.0.0.tgz", "rawSpec": "^1.0.0",
"saveSpec": "file:toolkit\\actions-exec-0.0.0.tgz", "saveSpec": null,
"fetchSpec": "C:\\Users\\Administrator\\Documents\\setup-node\\toolkit\\actions-exec-0.0.0.tgz" "fetchSpec": "^1.0.0"
}, },
"_requiredBy": [ "_requiredBy": [
"/",
"/@actions/tool-cache" "/@actions/tool-cache"
], ],
"_resolved": "C:\\Users\\Administrator\\Documents\\setup-node\\toolkit\\actions-exec-0.0.0.tgz", "_resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.0.tgz",
"_shasum": "341d868fe6c4123ded20db9c2106b7b8c16e1d73", "_shasum": "70c8b698c9baa02965c07da5f0b185ca56f0a955",
"_spec": "@actions/exec@file:toolkit/actions-exec-0.0.0.tgz", "_spec": "@actions/exec@^1.0.0",
"_where": "C:\\Users\\Administrator\\Documents\\setup-node", "_where": "C:\\Users\\damccorm\\Documents\\setup-node\\node_modules\\@actions\\tool-cache",
"bugs": { "bugs": {
"url": "https://github.com/actions/toolkit/issues" "url": "https://github.com/actions/toolkit/issues"
}, },
@ -31,7 +30,7 @@
"deprecated": false, "deprecated": false,
"description": "Actions exec lib", "description": "Actions exec lib",
"devDependencies": { "devDependencies": {
"@actions/io": "^0.0.0" "@actions/io": "^1.0.0"
}, },
"directories": { "directories": {
"lib": "lib", "lib": "lib",
@ -40,6 +39,7 @@
"files": [ "files": [
"lib" "lib"
], ],
"gitHead": "a40bce7c8d382aa3dbadaa327acbc696e9390e55",
"homepage": "https://github.com/actions/toolkit/tree/master/packages/exec", "homepage": "https://github.com/actions/toolkit/tree/master/packages/exec",
"keywords": [ "keywords": [
"exec", "exec",
@ -59,5 +59,5 @@
"test": "echo \"Error: run tests from root\" && exit 1", "test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc" "tsc": "tsc"
}, },
"version": "0.0.0" "version": "1.0.0"
} }

View File

@ -1,7 +0,0 @@
# `@actions/exit`
> TODO: description
## Usage
See [src/exit.ts](src/exit.ts).

View File

@ -1,29 +0,0 @@
/**
* The code to exit an action
*/
export declare enum ExitCode {
/**
* A code indicating that the action was successful
*/
Success = 0,
/**
* A code indicating that the action was a failure
*/
Failure = 1,
/**
* A code indicating that the action is complete, but neither succeeded nor failed
*/
Neutral = 78
}
/**
* Exit the action as a success.
*/
export declare function success(): void;
/**
* Exit the action as a failure.
*/
export declare function failure(): void;
/**
* Exit the action neither a success or a failure
*/
export declare function neutral(): void;

View File

@ -1,44 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* The code to exit an action
*/
var ExitCode;
(function (ExitCode) {
/**
* A code indicating that the action was successful
*/
ExitCode[ExitCode["Success"] = 0] = "Success";
/**
* A code indicating that the action was a failure
*/
ExitCode[ExitCode["Failure"] = 1] = "Failure";
/**
* A code indicating that the action is complete, but neither succeeded nor failed
*/
ExitCode[ExitCode["Neutral"] = 78] = "Neutral";
})(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
// TODO: These exit codes may not behave as expected on the new runtime, due to
// complexities of async logging and sync exiting.
/**
* Exit the action as a success.
*/
function success() {
process.exit(ExitCode.Success);
}
exports.success = success;
/**
* Exit the action as a failure.
*/
function failure() {
process.exit(ExitCode.Failure);
}
exports.failure = failure;
/**
* Exit the action neither a success or a failure
*/
function neutral() {
process.exit(ExitCode.Neutral);
}
exports.neutral = neutral;
//# sourceMappingURL=exit.js.map

View File

@ -1 +0,0 @@
{"version":3,"file":"exit.js","sourceRoot":"","sources":["../src/exit.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,IAAY,QAeX;AAfD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,8CAAY,CAAA;AACd,CAAC,EAfW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAenB;AAED,+EAA+E;AAC/E,kDAAkD;AAElD;;GAEG;AACH,SAAgB,OAAO;IACrB,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;AAChC,CAAC;AAFD,0BAEC;AAED;;GAEG;AACH,SAAgB,OAAO;IACrB,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;AAChC,CAAC;AAFD,0BAEC;AAED;;GAEG;AACH,SAAgB,OAAO;IACrB,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;AAChC,CAAC;AAFD,0BAEC"}

View File

@ -1,61 +0,0 @@
{
"_from": "file:toolkit\\actions-exit-0.0.0.tgz",
"_id": "@actions/exit@0.0.0",
"_inBundle": false,
"_integrity": "sha512-vQdxFWM0/AERkC79mQ886SqPmV4joWhrSF7hiSTiJoKkE9eTjrKV5WQtp7SXv6OntrQkKX+ZjgdGpv+0rvJRCw==",
"_location": "/@actions/exit",
"_phantomChildren": {},
"_requested": {
"type": "file",
"where": "C:\\Users\\Administrator\\Documents\\setup-node",
"raw": "@actions/exit@file:toolkit/actions-exit-0.0.0.tgz",
"name": "@actions/exit",
"escapedName": "@actions%2fexit",
"scope": "@actions",
"rawSpec": "file:toolkit/actions-exit-0.0.0.tgz",
"saveSpec": "file:toolkit\\actions-exit-0.0.0.tgz",
"fetchSpec": "C:\\Users\\Administrator\\Documents\\setup-node\\toolkit\\actions-exit-0.0.0.tgz"
},
"_requiredBy": [
"/",
"/@actions/core"
],
"_resolved": "C:\\Users\\Administrator\\Documents\\setup-node\\toolkit\\actions-exit-0.0.0.tgz",
"_shasum": "d47c8c61b45750ae49fea3061e3419a547b2a48f",
"_spec": "@actions/exit@file:toolkit/actions-exit-0.0.0.tgz",
"_where": "C:\\Users\\Administrator\\Documents\\setup-node",
"bugs": {
"url": "https://github.com/actions/toolkit/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Functions for safely exiting from GitHub Actions",
"directories": {
"lib": "lib",
"test": "__tests__"
},
"files": [
"lib"
],
"homepage": "https://github.com/actions/toolkit/tree/master/packages/exit",
"keywords": [
"github",
"actions",
"toolkit"
],
"license": "MIT",
"main": "lib/exit.js",
"name": "@actions/exit",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/actions/toolkit.git"
},
"scripts": {
"test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc"
},
"version": "0.0.0"
}

7
node_modules/@actions/github/LICENSE.md generated vendored Normal file
View File

@ -0,0 +1,7 @@
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -1,29 +1,28 @@
{ {
"_from": "file:toolkit\\actions-github-0.0.0.tgz", "_from": "@actions/github@^1.0.0",
"_id": "@actions/github@0.0.0", "_id": "@actions/github@1.0.0",
"_inBundle": false, "_inBundle": false,
"_integrity": "sha512-CByX5VIagC5BqGwsHD9Qt5MfN+H6GDC9qQl+MIUipaHTc89sUG/vAY/xQDS9vxuuRwrxbdERwKO3dR6U1BSziw==", "_integrity": "sha512-PPbWZ5wFAD/Vr+RCECfR3KNHjTwYln4liJBihs9tQUL0/PCFqB2lSkIh9V94AcZFHxgKk8snImjuLaBE8bKR7A==",
"_location": "/@actions/github", "_location": "/@actions/github",
"_phantomChildren": {}, "_phantomChildren": {},
"_requested": { "_requested": {
"type": "file", "type": "range",
"where": "C:\\Users\\Administrator\\Documents\\setup-node", "registry": true,
"raw": "@actions/github@file:toolkit/actions-github-0.0.0.tgz", "raw": "@actions/github@^1.0.0",
"name": "@actions/github", "name": "@actions/github",
"escapedName": "@actions%2fgithub", "escapedName": "@actions%2fgithub",
"scope": "@actions", "scope": "@actions",
"rawSpec": "file:toolkit/actions-github-0.0.0.tgz", "rawSpec": "^1.0.0",
"saveSpec": "file:toolkit\\actions-github-0.0.0.tgz", "saveSpec": null,
"fetchSpec": "C:\\Users\\Administrator\\Documents\\setup-node\\toolkit\\actions-github-0.0.0.tgz" "fetchSpec": "^1.0.0"
}, },
"_requiredBy": [ "_requiredBy": [
"#USER",
"/" "/"
], ],
"_resolved": "C:\\Users\\Administrator\\Documents\\setup-node\\toolkit\\actions-github-0.0.0.tgz", "_resolved": "https://registry.npmjs.org/@actions/github/-/github-1.0.0.tgz",
"_shasum": "d9a87b3682d66d032fffcaff1adcdb2decd92b81", "_shasum": "5154cadd93c4b17217f56304ee27056730b8ae88",
"_spec": "@actions/github@file:toolkit/actions-github-0.0.0.tgz", "_spec": "@actions/github@^1.0.0",
"_where": "C:\\Users\\Administrator\\Documents\\setup-node", "_where": "C:\\Users\\damccorm\\Documents\\setup-node",
"bugs": { "bugs": {
"url": "https://github.com/actions/toolkit/issues" "url": "https://github.com/actions/toolkit/issues"
}, },
@ -44,6 +43,7 @@
"files": [ "files": [
"lib" "lib"
], ],
"gitHead": "a40bce7c8d382aa3dbadaa327acbc696e9390e55",
"homepage": "https://github.com/actions/toolkit/tree/master/packages/github", "homepage": "https://github.com/actions/toolkit/tree/master/packages/github",
"keywords": [ "keywords": [
"github", "github",
@ -64,5 +64,5 @@
"test": "jest", "test": "jest",
"tsc": "tsc" "tsc": "tsc"
}, },
"version": "0.0.0" "version": "1.0.0"
} }

7
node_modules/@actions/io/LICENSE.md generated vendored Normal file
View File

@ -0,0 +1,7 @@
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

2
node_modules/@actions/io/README.md generated vendored
View File

@ -50,4 +50,4 @@ const io = require('@actions/io');
const pythonPath: string = await io.which('python', true) const pythonPath: string = await io.which('python', true)
await exec.exec(`"${pythonPath}"`, ['main.py']); await exec.exec(`"${pythonPath}"`, ['main.py']);
``` ```

View File

@ -1,30 +1,29 @@
{ {
"_from": "file:toolkit\\actions-io-0.0.0.tgz", "_from": "@actions/io@^1.0.0",
"_id": "@actions/io@0.0.0", "_id": "@actions/io@1.0.0",
"_inBundle": false, "_inBundle": false,
"_integrity": "sha512-MZUGyOe6m26Ns6ZQnr2JvxXzlwZ33XWYG392b5YuPMim1CE8DbuiBHtqOZeHVm5PenS4fRUG3qMTiMymve1DUA==", "_integrity": "sha512-ezrJSRdqtXtdx1WXlfYL85+40F7gB39jCK9P0jZVODW3W6xUYmu6ZOEc/UmmElUwhRyDRm1R4yNZu1Joq2kuQg==",
"_location": "/@actions/io", "_location": "/@actions/io",
"_phantomChildren": {}, "_phantomChildren": {},
"_requested": { "_requested": {
"type": "file", "type": "range",
"where": "C:\\Users\\Administrator\\Documents\\setup-node", "registry": true,
"raw": "@actions/io@file:toolkit/actions-io-0.0.0.tgz", "raw": "@actions/io@^1.0.0",
"name": "@actions/io", "name": "@actions/io",
"escapedName": "@actions%2fio", "escapedName": "@actions%2fio",
"scope": "@actions", "scope": "@actions",
"rawSpec": "file:toolkit/actions-io-0.0.0.tgz", "rawSpec": "^1.0.0",
"saveSpec": "file:toolkit\\actions-io-0.0.0.tgz", "saveSpec": null,
"fetchSpec": "C:\\Users\\Administrator\\Documents\\setup-node\\toolkit\\actions-io-0.0.0.tgz" "fetchSpec": "^1.0.0"
}, },
"_requiredBy": [ "_requiredBy": [
"#USER",
"/", "/",
"/@actions/tool-cache" "/@actions/tool-cache"
], ],
"_resolved": "C:\\Users\\Administrator\\Documents\\setup-node\\toolkit\\actions-io-0.0.0.tgz", "_resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.0.tgz",
"_shasum": "b9fd92bae7bfb507c75e3e35a107750901a51d00", "_shasum": "379454174660623bb5b3bce0be8b9e2285a62bcb",
"_spec": "@actions/io@file:toolkit/actions-io-0.0.0.tgz", "_spec": "@actions/io@^1.0.0",
"_where": "C:\\Users\\Administrator\\Documents\\setup-node", "_where": "C:\\Users\\damccorm\\Documents\\setup-node",
"bugs": { "bugs": {
"url": "https://github.com/actions/toolkit/issues" "url": "https://github.com/actions/toolkit/issues"
}, },
@ -38,6 +37,7 @@
"files": [ "files": [
"lib" "lib"
], ],
"gitHead": "a40bce7c8d382aa3dbadaa327acbc696e9390e55",
"homepage": "https://github.com/actions/toolkit/tree/master/packages/io", "homepage": "https://github.com/actions/toolkit/tree/master/packages/io",
"keywords": [ "keywords": [
"io", "io",
@ -57,5 +57,5 @@
"test": "echo \"Error: run tests from root\" && exit 1", "test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc" "tsc": "tsc"
}, },
"version": "0.0.0" "version": "1.0.0"
} }

7
node_modules/@actions/tool-cache/LICENSE.md generated vendored Normal file
View File

@ -0,0 +1,7 @@
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -433,4 +433,4 @@ function _evaluateVersions(versions, versionSpec) {
} }
return version; return version;
} }
//# sourceMappingURL=tool-cache.js.map //# sourceMappingURL=tool-cache.js.map

View File

@ -1,37 +1,36 @@
{ {
"_from": "file:toolkit\\actions-tool-cache-0.0.0.tgz", "_from": "@actions/tool-cache@^1.0.0",
"_id": "@actions/tool-cache@0.0.0", "_id": "@actions/tool-cache@1.0.0",
"_inBundle": false, "_inBundle": false,
"_integrity": "sha512-33oYAVRdp6MWNT7Yca0//SmOsvpE7FpFfNA/LzwjIZdLucHaO6V67dqZ5p81CTBncrZal+O5kE9B8qSk0rhipg==", "_integrity": "sha512-l3zT0IfDfi5Ik5aMpnXqGHGATxN8xa9ls4ue+X/CBXpPhRMRZS4vcuh5Q9T98WAGbkysRCfhpbksTPHIcKnNwQ==",
"_location": "/@actions/tool-cache", "_location": "/@actions/tool-cache",
"_phantomChildren": {}, "_phantomChildren": {},
"_requested": { "_requested": {
"type": "file", "type": "range",
"where": "C:\\Users\\Administrator\\Documents\\setup-node", "registry": true,
"raw": "@actions/tool-cache@file:toolkit/actions-tool-cache-0.0.0.tgz", "raw": "@actions/tool-cache@^1.0.0",
"name": "@actions/tool-cache", "name": "@actions/tool-cache",
"escapedName": "@actions%2ftool-cache", "escapedName": "@actions%2ftool-cache",
"scope": "@actions", "scope": "@actions",
"rawSpec": "file:toolkit/actions-tool-cache-0.0.0.tgz", "rawSpec": "^1.0.0",
"saveSpec": "file:toolkit\\actions-tool-cache-0.0.0.tgz", "saveSpec": null,
"fetchSpec": "C:\\Users\\Administrator\\Documents\\setup-node\\toolkit\\actions-tool-cache-0.0.0.tgz" "fetchSpec": "^1.0.0"
}, },
"_requiredBy": [ "_requiredBy": [
"#USER",
"/" "/"
], ],
"_resolved": "C:\\Users\\Administrator\\Documents\\setup-node\\toolkit\\actions-tool-cache-0.0.0.tgz", "_resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.0.0.tgz",
"_shasum": "ce9e7d81ebb138911d20b9f74c8aa6120caac9b1", "_shasum": "a9ac414bd2e0bf1f5f0302f029193c418d344c09",
"_spec": "@actions/tool-cache@file:toolkit/actions-tool-cache-0.0.0.tgz", "_spec": "@actions/tool-cache@^1.0.0",
"_where": "C:\\Users\\Administrator\\Documents\\setup-node", "_where": "C:\\Users\\damccorm\\Documents\\setup-node",
"bugs": { "bugs": {
"url": "https://github.com/actions/toolkit/issues" "url": "https://github.com/actions/toolkit/issues"
}, },
"bundleDependencies": false, "bundleDependencies": false,
"dependencies": { "dependencies": {
"@actions/core": "^0.0.0", "@actions/core": "^1.0.0",
"@actions/exec": "^0.0.0", "@actions/exec": "^1.0.0",
"@actions/io": "^0.0.0", "@actions/io": "^1.0.0",
"semver": "^6.1.0", "semver": "^6.1.0",
"typed-rest-client": "^1.4.0", "typed-rest-client": "^1.4.0",
"uuid": "^3.3.2" "uuid": "^3.3.2"
@ -52,6 +51,7 @@
"lib", "lib",
"scripts" "scripts"
], ],
"gitHead": "a40bce7c8d382aa3dbadaa327acbc696e9390e55",
"homepage": "https://github.com/actions/toolkit/tree/master/packages/exec", "homepage": "https://github.com/actions/toolkit/tree/master/packages/exec",
"keywords": [ "keywords": [
"exec", "exec",
@ -71,5 +71,5 @@
"test": "echo \"Error: run tests from root\" && exit 1", "test": "echo \"Error: run tests from root\" && exit 1",
"tsc": "tsc" "tsc": "tsc"
}, },
"version": "0.0.0" "version": "1.0.0"
} }

79
package-lock.json generated
View File

@ -5,39 +5,37 @@
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@actions/core": { "@actions/core": {
"version": "file:toolkit/actions-core-0.0.0.tgz", "version": "1.0.0",
"integrity": "sha512-58ituSV1rzBMmmsWoFDnrnsT+Wm4kD/u9NgAGbPvZ7rQHWluYtD5bDbIsjDC6rKFuhqytkxDJPsF/TWBdgc/nA==", "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.0.0.tgz",
"requires": { "integrity": "sha512-aMIlkx96XH4E/2YZtEOeyrYQfhlas9jIRkfGPqMwXD095Rdkzo4lB6ZmbxPQSzD+e1M+Xsm98ZhuSMYGv/AlqA=="
"@actions/exit": "^0.0.0"
}
}, },
"@actions/exec": { "@actions/exec": {
"version": "file:toolkit/actions-exec-0.0.0.tgz", "version": "1.0.0",
"integrity": "sha512-HHObusC4p1RElxIlrrN0sY/cweBYl+jKm3J/XWHPQZMipgJXB/dkVhUfl4KqH3Vim7oM2KjCGSfn+vTYrqVH3A==" "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.0.tgz",
}, "integrity": "sha512-nquH0+XKng+Ll7rZfCojN7NWSbnGh+ltwUJhzfbLkmOJgxocGX2/yXcZLMyT9fa7+tByEow/NSTrBExNlEj9fw=="
"@actions/exit": {
"version": "file:toolkit/actions-exit-0.0.0.tgz",
"integrity": "sha512-vQdxFWM0/AERkC79mQ886SqPmV4joWhrSF7hiSTiJoKkE9eTjrKV5WQtp7SXv6OntrQkKX+ZjgdGpv+0rvJRCw=="
}, },
"@actions/github": { "@actions/github": {
"version": "file:toolkit/actions-github-0.0.0.tgz", "version": "1.0.0",
"integrity": "sha512-CByX5VIagC5BqGwsHD9Qt5MfN+H6GDC9qQl+MIUipaHTc89sUG/vAY/xQDS9vxuuRwrxbdERwKO3dR6U1BSziw==", "resolved": "https://registry.npmjs.org/@actions/github/-/github-1.0.0.tgz",
"integrity": "sha512-PPbWZ5wFAD/Vr+RCECfR3KNHjTwYln4liJBihs9tQUL0/PCFqB2lSkIh9V94AcZFHxgKk8snImjuLaBE8bKR7A==",
"requires": { "requires": {
"@octokit/graphql": "^2.0.1", "@octokit/graphql": "^2.0.1",
"@octokit/rest": "^16.15.0" "@octokit/rest": "^16.15.0"
} }
}, },
"@actions/io": { "@actions/io": {
"version": "file:toolkit/actions-io-0.0.0.tgz", "version": "1.0.0",
"integrity": "sha512-MZUGyOe6m26Ns6ZQnr2JvxXzlwZ33XWYG392b5YuPMim1CE8DbuiBHtqOZeHVm5PenS4fRUG3qMTiMymve1DUA==" "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.0.tgz",
"integrity": "sha512-ezrJSRdqtXtdx1WXlfYL85+40F7gB39jCK9P0jZVODW3W6xUYmu6ZOEc/UmmElUwhRyDRm1R4yNZu1Joq2kuQg=="
}, },
"@actions/tool-cache": { "@actions/tool-cache": {
"version": "file:toolkit/actions-tool-cache-0.0.0.tgz", "version": "1.0.0",
"integrity": "sha512-33oYAVRdp6MWNT7Yca0//SmOsvpE7FpFfNA/LzwjIZdLucHaO6V67dqZ5p81CTBncrZal+O5kE9B8qSk0rhipg==", "resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.0.0.tgz",
"integrity": "sha512-l3zT0IfDfi5Ik5aMpnXqGHGATxN8xa9ls4ue+X/CBXpPhRMRZS4vcuh5Q9T98WAGbkysRCfhpbksTPHIcKnNwQ==",
"requires": { "requires": {
"@actions/core": "^0.0.0", "@actions/core": "^1.0.0",
"@actions/exec": "^0.0.0", "@actions/exec": "^1.0.0",
"@actions/io": "^0.0.0", "@actions/io": "^1.0.0",
"semver": "^6.1.0", "semver": "^6.1.0",
"typed-rest-client": "^1.4.0", "typed-rest-client": "^1.4.0",
"uuid": "^3.3.2" "uuid": "^3.3.2"
@ -1885,7 +1883,8 @@
"ansi-regex": { "ansi-regex": {
"version": "2.1.1", "version": "2.1.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"aproba": { "aproba": {
"version": "1.2.0", "version": "1.2.0",
@ -1906,12 +1905,14 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -1926,17 +1927,20 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -2053,7 +2057,8 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -2065,6 +2070,7 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -2079,6 +2085,7 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -2086,12 +2093,14 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.3.5", "version": "2.3.5",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.2", "safe-buffer": "^5.1.2",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -2110,6 +2119,7 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -2190,7 +2200,8 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -2202,6 +2213,7 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -2287,7 +2299,8 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"safer-buffer": { "safer-buffer": {
"version": "2.1.2", "version": "2.1.2",
@ -2323,6 +2336,7 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -2342,6 +2356,7 @@
"version": "3.0.1", "version": "3.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"ansi-regex": "^2.0.0" "ansi-regex": "^2.0.0"
} }
@ -2385,12 +2400,14 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
}, },
"yallist": { "yallist": {
"version": "3.0.3", "version": "3.0.3",
"bundled": true, "bundled": true,
"dev": true "dev": true,
"optional": true
} }
} }
}, },

View File

@ -22,12 +22,11 @@
"author": "GitHub", "author": "GitHub",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@actions/core": "file:toolkit/actions-core-0.0.0.tgz", "@actions/core": "^1.0.0",
"@actions/exec": "file:toolkit/actions-exec-0.0.0.tgz", "@actions/github": "^1.0.0",
"@actions/exit": "file:toolkit/actions-exit-0.0.0.tgz", "@actions/io": "^1.0.0",
"@actions/github": "file:toolkit/actions-github-0.0.0.tgz", "@actions/tool-cache": "^1.0.0",
"@actions/io": "file:toolkit/actions-io-0.0.0.tgz", "typed-rest-client": "^1.5.0",
"@actions/tool-cache": "file:toolkit/actions-tool-cache-0.0.0.tgz",
"semver": "^6.1.1" "semver": "^6.1.1"
}, },
"devDependencies": { "devDependencies": {

View File

@ -24,6 +24,9 @@ function writeRegistryToFile(registryUrl: string, fileLocation: string) {
if (scope && scope[0] != '@') { if (scope && scope[0] != '@') {
scope = '@' + scope; scope = '@' + scope;
} }
if (scope) {
scope = scope.toLowerCase();
}
core.debug(`Setting auth in ${fileLocation}`); core.debug(`Setting auth in ${fileLocation}`);
let newContents: string = ''; let newContents: string = '';

View File

@ -100,7 +100,7 @@ async function queryLatestMatch(versionSpec: string): Promise<string> {
let versions: string[] = []; let versions: string[] = [];
let dataUrl = 'https://nodejs.org/dist/index.json'; let dataUrl = 'https://nodejs.org/dist/index.json';
let rest: restm.RestClient = new restm.RestClient('vsts-node-tool'); let rest: restm.RestClient = new restm.RestClient('setup-node');
let nodeVersions: INodeVersion[] = let nodeVersions: INodeVersion[] =
(await rest.get<INodeVersion[]>(dataUrl)).result || []; (await rest.get<INodeVersion[]>(dataUrl)).result || [];
nodeVersions.forEach((nodeVersion: INodeVersion) => { nodeVersions.forEach((nodeVersion: INodeVersion) => {

View File

@ -9,7 +9,10 @@ async function run() {
// Version is optional. If supplied, install / use from the tool cache // Version is optional. If supplied, install / use from the tool cache
// If not supplied then task is still used to setup proxy, auth, etc... // If not supplied then task is still used to setup proxy, auth, etc...
// //
const version = core.getInput('version'); let version = core.getInput('version');
if (!version) {
version = core.getInput('node-version');
}
if (version) { if (version) {
// TODO: installer doesn't support proxy // TODO: installer doesn't support proxy
await installer.getNode(version); await installer.getNode(version);