mirror of
https://github.com/shimataro/ssh-key-action.git
synced 2025-06-19 22:52:10 +10:00
Untrack node_modules/@actions
This commit is contained in:
parent
a13e038d52
commit
f3a3c389f7
8 changed files with 0 additions and 649 deletions
146
node_modules/@actions/core/README.md
generated
vendored
146
node_modules/@actions/core/README.md
generated
vendored
|
@ -1,146 +0,0 @@
|
||||||
# `@actions/core`
|
|
||||||
|
|
||||||
> Core functions for setting results, logging, registering secrets and exporting variables across actions
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
### Import the package
|
|
||||||
|
|
||||||
```js
|
|
||||||
// javascript
|
|
||||||
const core = require('@actions/core');
|
|
||||||
|
|
||||||
// typescript
|
|
||||||
import * as core from '@actions/core';
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Inputs/Outputs
|
|
||||||
|
|
||||||
Action inputs can be read with `getInput`. Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled.
|
|
||||||
|
|
||||||
```js
|
|
||||||
const myInput = core.getInput('inputName', { required: true });
|
|
||||||
|
|
||||||
core.setOutput('outputKey', 'outputVal');
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Exporting variables
|
|
||||||
|
|
||||||
Since each step runs in a separate process, you can use `exportVariable` to add it to this step and future steps environment blocks.
|
|
||||||
|
|
||||||
```js
|
|
||||||
core.exportVariable('envVar', 'Val');
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Setting a secret
|
|
||||||
|
|
||||||
Setting a secret registers the secret with the runner to ensure it is masked in logs.
|
|
||||||
|
|
||||||
```js
|
|
||||||
core.setSecret('myPassword');
|
|
||||||
```
|
|
||||||
|
|
||||||
#### PATH Manipulation
|
|
||||||
|
|
||||||
To make a tool's path available in the path for the remainder of the job (without altering the machine or containers state), use `addPath`. The runner will prepend the path given to the jobs PATH.
|
|
||||||
|
|
||||||
```js
|
|
||||||
core.addPath('/path/to/mytool');
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Exit codes
|
|
||||||
|
|
||||||
You should use this library to set the failing exit code for your action. If status is not set and the script runs to completion, that will lead to a success.
|
|
||||||
|
|
||||||
```js
|
|
||||||
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}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
Note that `setNeutral` is not yet implemented in actions V2 but equivalent functionality is being planned.
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Logging
|
|
||||||
|
|
||||||
Finally, this library provides some utilities for logging. Note that debug logging is hidden from the logs by default. This behavior can be toggled by enabling the [Step Debug Logs](../../docs/action-debugging.md#step-debug-logs).
|
|
||||||
|
|
||||||
```js
|
|
||||||
const core = require('@actions/core');
|
|
||||||
|
|
||||||
const myInput = core.getInput('input');
|
|
||||||
try {
|
|
||||||
core.debug('Inside try block');
|
|
||||||
|
|
||||||
if (!myInput) {
|
|
||||||
core.warning('myInput was not set');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (core.isDebug()) {
|
|
||||||
// curl -v https://github.com
|
|
||||||
} else {
|
|
||||||
// curl https://github.com
|
|
||||||
}
|
|
||||||
|
|
||||||
// Do stuff
|
|
||||||
}
|
|
||||||
catch (err) {
|
|
||||||
core.error(`Error ${err}, action may still succeed though`);
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
This library can also wrap chunks of output in foldable groups.
|
|
||||||
|
|
||||||
```js
|
|
||||||
const core = require('@actions/core')
|
|
||||||
|
|
||||||
// Manually wrap output
|
|
||||||
core.startGroup('Do some function')
|
|
||||||
doSomeFunction()
|
|
||||||
core.endGroup()
|
|
||||||
|
|
||||||
// Wrap an asynchronous function call
|
|
||||||
const result = await core.group('Do something async', async () => {
|
|
||||||
const response = await doSomeHTTPRequest()
|
|
||||||
return response
|
|
||||||
})
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Action state
|
|
||||||
|
|
||||||
You can use this library to save state and get state for sharing information between a given wrapper action:
|
|
||||||
|
|
||||||
**action.yml**
|
|
||||||
```yaml
|
|
||||||
name: 'Wrapper action sample'
|
|
||||||
inputs:
|
|
||||||
name:
|
|
||||||
default: 'GitHub'
|
|
||||||
runs:
|
|
||||||
using: 'node12'
|
|
||||||
main: 'main.js'
|
|
||||||
post: 'cleanup.js'
|
|
||||||
```
|
|
||||||
|
|
||||||
In action's `main.js`:
|
|
||||||
|
|
||||||
```js
|
|
||||||
const core = require('@actions/core');
|
|
||||||
|
|
||||||
core.saveState("pidToKill", 12345);
|
|
||||||
```
|
|
||||||
|
|
||||||
In action's `cleanup.js`:
|
|
||||||
```js
|
|
||||||
const core = require('@actions/core');
|
|
||||||
|
|
||||||
var pid = core.getState("pidToKill");
|
|
||||||
|
|
||||||
process.kill(pid);
|
|
||||||
```
|
|
21
node_modules/@actions/core/lib/command.d.ts
generated
vendored
21
node_modules/@actions/core/lib/command.d.ts
generated
vendored
|
@ -1,21 +0,0 @@
|
||||||
interface CommandProperties {
|
|
||||||
[key: string]: any;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Commands
|
|
||||||
*
|
|
||||||
* Command Format:
|
|
||||||
* ::name key=value,key=value::message
|
|
||||||
*
|
|
||||||
* Examples:
|
|
||||||
* ::warning::This is the message
|
|
||||||
* ::set-env name=MY_VAR::some value
|
|
||||||
*/
|
|
||||||
export declare function issueCommand(command: string, properties: CommandProperties, message: any): void;
|
|
||||||
export declare function issue(name: string, message?: string): void;
|
|
||||||
/**
|
|
||||||
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
|
||||||
* @param input input to sanitize into a string
|
|
||||||
*/
|
|
||||||
export declare function toCommandValue(input: any): string;
|
|
||||||
export {};
|
|
92
node_modules/@actions/core/lib/command.js
generated
vendored
92
node_modules/@actions/core/lib/command.js
generated
vendored
|
@ -1,92 +0,0 @@
|
||||||
"use strict";
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
||||||
result["default"] = mod;
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const os = __importStar(require("os"));
|
|
||||||
/**
|
|
||||||
* Commands
|
|
||||||
*
|
|
||||||
* Command Format:
|
|
||||||
* ::name key=value,key=value::message
|
|
||||||
*
|
|
||||||
* Examples:
|
|
||||||
* ::warning::This is the message
|
|
||||||
* ::set-env name=MY_VAR::some value
|
|
||||||
*/
|
|
||||||
function issueCommand(command, properties, message) {
|
|
||||||
const cmd = new Command(command, properties, message);
|
|
||||||
process.stdout.write(cmd.toString() + os.EOL);
|
|
||||||
}
|
|
||||||
exports.issueCommand = issueCommand;
|
|
||||||
function issue(name, message = '') {
|
|
||||||
issueCommand(name, {}, message);
|
|
||||||
}
|
|
||||||
exports.issue = issue;
|
|
||||||
const CMD_STRING = '::';
|
|
||||||
class Command {
|
|
||||||
constructor(command, properties, message) {
|
|
||||||
if (!command) {
|
|
||||||
command = 'missing.command';
|
|
||||||
}
|
|
||||||
this.command = command;
|
|
||||||
this.properties = properties;
|
|
||||||
this.message = message;
|
|
||||||
}
|
|
||||||
toString() {
|
|
||||||
let cmdStr = CMD_STRING + this.command;
|
|
||||||
if (this.properties && Object.keys(this.properties).length > 0) {
|
|
||||||
cmdStr += ' ';
|
|
||||||
let first = true;
|
|
||||||
for (const key in this.properties) {
|
|
||||||
if (this.properties.hasOwnProperty(key)) {
|
|
||||||
const val = this.properties[key];
|
|
||||||
if (val) {
|
|
||||||
if (first) {
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
cmdStr += ',';
|
|
||||||
}
|
|
||||||
cmdStr += `${key}=${escapeProperty(val)}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
|
|
||||||
return cmdStr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* Sanitizes an input into a string so it can be passed into issueCommand safely
|
|
||||||
* @param input input to sanitize into a string
|
|
||||||
*/
|
|
||||||
function toCommandValue(input) {
|
|
||||||
if (input === null || input === undefined) {
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
else if (typeof input === 'string' || input instanceof String) {
|
|
||||||
return input;
|
|
||||||
}
|
|
||||||
return JSON.stringify(input);
|
|
||||||
}
|
|
||||||
exports.toCommandValue = toCommandValue;
|
|
||||||
function escapeData(s) {
|
|
||||||
return toCommandValue(s)
|
|
||||||
.replace(/%/g, '%25')
|
|
||||||
.replace(/\r/g, '%0D')
|
|
||||||
.replace(/\n/g, '%0A');
|
|
||||||
}
|
|
||||||
function escapeProperty(s) {
|
|
||||||
return toCommandValue(s)
|
|
||||||
.replace(/%/g, '%25')
|
|
||||||
.replace(/\r/g, '%0D')
|
|
||||||
.replace(/\n/g, '%0A')
|
|
||||||
.replace(/:/g, '%3A')
|
|
||||||
.replace(/,/g, '%2C');
|
|
||||||
}
|
|
||||||
//# sourceMappingURL=command.js.map
|
|
1
node_modules/@actions/core/lib/command.js.map
generated
vendored
1
node_modules/@actions/core/lib/command.js.map
generated
vendored
|
@ -1 +0,0 @@
|
||||||
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAwB;AAWxB;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAY;IAEZ,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;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ED;;;GAGG;AACH,SAAgB,cAAc,CAAC,KAAU;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,EAAE;QACzC,OAAO,EAAE,CAAA;KACV;SAAM,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,YAAY,MAAM,EAAE;QAC/D,OAAO,KAAe,CAAA;KACvB;IACD,OAAO,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAPD,wCAOC;AAED,SAAS,UAAU,CAAC,CAAM;IACxB,OAAO,cAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAM;IAC5B,OAAO,cAAc,CAAC,CAAC,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"}
|
|
122
node_modules/@actions/core/lib/core.d.ts
generated
vendored
122
node_modules/@actions/core/lib/core.d.ts
generated
vendored
|
@ -1,122 +0,0 @@
|
||||||
/**
|
|
||||||
* Interface for getInput options
|
|
||||||
*/
|
|
||||||
export interface InputOptions {
|
|
||||||
/** Optional. Whether the input is required. If required and not present, will throw. Defaults to false */
|
|
||||||
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
|
|
||||||
* @param name the name of the variable to set
|
|
||||||
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
|
|
||||||
*/
|
|
||||||
export declare function exportVariable(name: string, val: any): void;
|
|
||||||
/**
|
|
||||||
* Registers a secret which will get masked from logs
|
|
||||||
* @param secret value of the secret
|
|
||||||
*/
|
|
||||||
export declare function setSecret(secret: string): void;
|
|
||||||
/**
|
|
||||||
* Prepends inputPath to the PATH (for this action and future actions)
|
|
||||||
* @param inputPath
|
|
||||||
*/
|
|
||||||
export declare function addPath(inputPath: string): void;
|
|
||||||
/**
|
|
||||||
* Gets the value of an input. The value is also trimmed.
|
|
||||||
*
|
|
||||||
* @param name name of the input to get
|
|
||||||
* @param options optional. See InputOptions.
|
|
||||||
* @returns string
|
|
||||||
*/
|
|
||||||
export declare function getInput(name: string, options?: InputOptions): string;
|
|
||||||
/**
|
|
||||||
* Sets the value of an output.
|
|
||||||
*
|
|
||||||
* @param name name of the output to set
|
|
||||||
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
|
||||||
*/
|
|
||||||
export declare function setOutput(name: string, value: any): void;
|
|
||||||
/**
|
|
||||||
* Enables or disables the echoing of commands into stdout for the rest of the step.
|
|
||||||
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
export declare function setCommandEcho(enabled: boolean): void;
|
|
||||||
/**
|
|
||||||
* Sets the action status to failed.
|
|
||||||
* When the action exits it will be with an exit code of 1
|
|
||||||
* @param message add error issue message
|
|
||||||
*/
|
|
||||||
export declare function setFailed(message: string | Error): void;
|
|
||||||
/**
|
|
||||||
* Gets whether Actions Step Debug is on or not
|
|
||||||
*/
|
|
||||||
export declare function isDebug(): boolean;
|
|
||||||
/**
|
|
||||||
* Writes debug message to user log
|
|
||||||
* @param message debug message
|
|
||||||
*/
|
|
||||||
export declare function debug(message: string): void;
|
|
||||||
/**
|
|
||||||
* Adds an error issue
|
|
||||||
* @param message error issue message. Errors will be converted to string via toString()
|
|
||||||
*/
|
|
||||||
export declare function error(message: string | Error): void;
|
|
||||||
/**
|
|
||||||
* Adds an warning issue
|
|
||||||
* @param message warning issue message. Errors will be converted to string via toString()
|
|
||||||
*/
|
|
||||||
export declare function warning(message: string | Error): void;
|
|
||||||
/**
|
|
||||||
* Writes info to log with console.log.
|
|
||||||
* @param message info message
|
|
||||||
*/
|
|
||||||
export declare function info(message: string): void;
|
|
||||||
/**
|
|
||||||
* Begin an output group.
|
|
||||||
*
|
|
||||||
* Output until the next `groupEnd` will be foldable in this group
|
|
||||||
*
|
|
||||||
* @param name The name of the output group
|
|
||||||
*/
|
|
||||||
export declare function startGroup(name: string): void;
|
|
||||||
/**
|
|
||||||
* End an output group.
|
|
||||||
*/
|
|
||||||
export declare function endGroup(): void;
|
|
||||||
/**
|
|
||||||
* Wrap an asynchronous function call in a group.
|
|
||||||
*
|
|
||||||
* Returns the same type as the function itself.
|
|
||||||
*
|
|
||||||
* @param name The name of the group
|
|
||||||
* @param fn The function to wrap in the group
|
|
||||||
*/
|
|
||||||
export declare function group<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
|
||||||
/**
|
|
||||||
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
|
||||||
*
|
|
||||||
* @param name name of the state to store
|
|
||||||
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
|
||||||
*/
|
|
||||||
export declare function saveState(name: string, value: any): void;
|
|
||||||
/**
|
|
||||||
* Gets the value of an state set by this action's main execution.
|
|
||||||
*
|
|
||||||
* @param name name of the state to get
|
|
||||||
* @returns string
|
|
||||||
*/
|
|
||||||
export declare function getState(name: string): string;
|
|
222
node_modules/@actions/core/lib/core.js
generated
vendored
222
node_modules/@actions/core/lib/core.js
generated
vendored
|
@ -1,222 +0,0 @@
|
||||||
"use strict";
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
||||||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
||||||
return new (P || (P = Promise))(function (resolve, reject) {
|
|
||||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
||||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
||||||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var __importStar = (this && this.__importStar) || function (mod) {
|
|
||||||
if (mod && mod.__esModule) return mod;
|
|
||||||
var result = {};
|
|
||||||
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
||||||
result["default"] = mod;
|
|
||||||
return result;
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const command_1 = require("./command");
|
|
||||||
const os = __importStar(require("os"));
|
|
||||||
const path = __importStar(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
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* Sets env variable for this action and future actions in the job
|
|
||||||
* @param name the name of the variable to set
|
|
||||||
* @param val the value of the variable. Non-string values will be converted to a string via JSON.stringify
|
|
||||||
*/
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
function exportVariable(name, val) {
|
|
||||||
const convertedVal = command_1.toCommandValue(val);
|
|
||||||
process.env[name] = convertedVal;
|
|
||||||
command_1.issueCommand('set-env', { name }, convertedVal);
|
|
||||||
}
|
|
||||||
exports.exportVariable = exportVariable;
|
|
||||||
/**
|
|
||||||
* Registers a secret which will get masked from logs
|
|
||||||
* @param secret value of the secret
|
|
||||||
*/
|
|
||||||
function setSecret(secret) {
|
|
||||||
command_1.issueCommand('add-mask', {}, secret);
|
|
||||||
}
|
|
||||||
exports.setSecret = setSecret;
|
|
||||||
/**
|
|
||||||
* Prepends inputPath to the PATH (for this action and future actions)
|
|
||||||
* @param inputPath
|
|
||||||
*/
|
|
||||||
function addPath(inputPath) {
|
|
||||||
command_1.issueCommand('add-path', {}, inputPath);
|
|
||||||
process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
|
|
||||||
}
|
|
||||||
exports.addPath = addPath;
|
|
||||||
/**
|
|
||||||
* Gets the value of an input. The value is also trimmed.
|
|
||||||
*
|
|
||||||
* @param name name of the input to get
|
|
||||||
* @param options optional. See InputOptions.
|
|
||||||
* @returns string
|
|
||||||
*/
|
|
||||||
function getInput(name, options) {
|
|
||||||
const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
|
|
||||||
if (options && options.required && !val) {
|
|
||||||
throw new Error(`Input required and not supplied: ${name}`);
|
|
||||||
}
|
|
||||||
return val.trim();
|
|
||||||
}
|
|
||||||
exports.getInput = getInput;
|
|
||||||
/**
|
|
||||||
* Sets the value of an output.
|
|
||||||
*
|
|
||||||
* @param name name of the output to set
|
|
||||||
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
|
||||||
*/
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
function setOutput(name, value) {
|
|
||||||
command_1.issueCommand('set-output', { name }, value);
|
|
||||||
}
|
|
||||||
exports.setOutput = setOutput;
|
|
||||||
/**
|
|
||||||
* Enables or disables the echoing of commands into stdout for the rest of the step.
|
|
||||||
* Echoing is disabled by default if ACTIONS_STEP_DEBUG is not set.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
function setCommandEcho(enabled) {
|
|
||||||
command_1.issue('echo', enabled ? 'on' : 'off');
|
|
||||||
}
|
|
||||||
exports.setCommandEcho = setCommandEcho;
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
// Results
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* Sets the action status to failed.
|
|
||||||
* When the action exits it will be with an exit code of 1
|
|
||||||
* @param message add error issue message
|
|
||||||
*/
|
|
||||||
function setFailed(message) {
|
|
||||||
process.exitCode = ExitCode.Failure;
|
|
||||||
error(message);
|
|
||||||
}
|
|
||||||
exports.setFailed = setFailed;
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
// Logging Commands
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* Gets whether Actions Step Debug is on or not
|
|
||||||
*/
|
|
||||||
function isDebug() {
|
|
||||||
return process.env['RUNNER_DEBUG'] === '1';
|
|
||||||
}
|
|
||||||
exports.isDebug = isDebug;
|
|
||||||
/**
|
|
||||||
* Writes debug message to user log
|
|
||||||
* @param message debug message
|
|
||||||
*/
|
|
||||||
function debug(message) {
|
|
||||||
command_1.issueCommand('debug', {}, message);
|
|
||||||
}
|
|
||||||
exports.debug = debug;
|
|
||||||
/**
|
|
||||||
* Adds an error issue
|
|
||||||
* @param message error issue message. Errors will be converted to string via toString()
|
|
||||||
*/
|
|
||||||
function error(message) {
|
|
||||||
command_1.issue('error', message instanceof Error ? message.toString() : message);
|
|
||||||
}
|
|
||||||
exports.error = error;
|
|
||||||
/**
|
|
||||||
* Adds an warning issue
|
|
||||||
* @param message warning issue message. Errors will be converted to string via toString()
|
|
||||||
*/
|
|
||||||
function warning(message) {
|
|
||||||
command_1.issue('warning', message instanceof Error ? message.toString() : message);
|
|
||||||
}
|
|
||||||
exports.warning = warning;
|
|
||||||
/**
|
|
||||||
* Writes info to log with console.log.
|
|
||||||
* @param message info message
|
|
||||||
*/
|
|
||||||
function info(message) {
|
|
||||||
process.stdout.write(message + os.EOL);
|
|
||||||
}
|
|
||||||
exports.info = info;
|
|
||||||
/**
|
|
||||||
* Begin an output group.
|
|
||||||
*
|
|
||||||
* Output until the next `groupEnd` will be foldable in this group
|
|
||||||
*
|
|
||||||
* @param name The name of the output group
|
|
||||||
*/
|
|
||||||
function startGroup(name) {
|
|
||||||
command_1.issue('group', name);
|
|
||||||
}
|
|
||||||
exports.startGroup = startGroup;
|
|
||||||
/**
|
|
||||||
* End an output group.
|
|
||||||
*/
|
|
||||||
function endGroup() {
|
|
||||||
command_1.issue('endgroup');
|
|
||||||
}
|
|
||||||
exports.endGroup = endGroup;
|
|
||||||
/**
|
|
||||||
* Wrap an asynchronous function call in a group.
|
|
||||||
*
|
|
||||||
* Returns the same type as the function itself.
|
|
||||||
*
|
|
||||||
* @param name The name of the group
|
|
||||||
* @param fn The function to wrap in the group
|
|
||||||
*/
|
|
||||||
function group(name, fn) {
|
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
startGroup(name);
|
|
||||||
let result;
|
|
||||||
try {
|
|
||||||
result = yield fn();
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
endGroup();
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
exports.group = group;
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
// Wrapper action state
|
|
||||||
//-----------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
|
||||||
*
|
|
||||||
* @param name name of the state to store
|
|
||||||
* @param value value to store. Non-string values will be converted to a string via JSON.stringify
|
|
||||||
*/
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
function saveState(name, value) {
|
|
||||||
command_1.issueCommand('save-state', { name }, value);
|
|
||||||
}
|
|
||||||
exports.saveState = saveState;
|
|
||||||
/**
|
|
||||||
* Gets the value of an state set by this action's main execution.
|
|
||||||
*
|
|
||||||
* @param name name of the state to get
|
|
||||||
* @returns string
|
|
||||||
*/
|
|
||||||
function getState(name) {
|
|
||||||
return process.env[`STATE_${name}`] || '';
|
|
||||||
}
|
|
||||||
exports.getState = getState;
|
|
||||||
//# sourceMappingURL=core.js.map
|
|
1
node_modules/@actions/core/lib/core.js.map
generated
vendored
1
node_modules/@actions/core/lib/core.js.map
generated
vendored
|
@ -1 +0,0 @@
|
||||||
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA6D;AAE7D,uCAAwB;AACxB,2CAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,8DAA8D;AAC9D,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAQ;IACnD,MAAM,YAAY,GAAG,wBAAc,CAAC,GAAG,CAAC,CAAA;IACxC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,YAAY,CAAA;IAChC,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,YAAY,CAAC,CAAA;AAC/C,CAAC;AAJD,wCAIC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAc;IACtC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;AACtC,CAAC;AAFD,8BAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACvC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;I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,yEAAyE;AACzE,uBAAuB;AACvB,yEAAyE;AAEzE;;;;;GAKG;AACH,8DAA8D;AAC9D,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAU;IAChD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;AAC3C,CAAC;AAFD,4BAEC"}
|
|
44
node_modules/@actions/core/package.json
generated
vendored
44
node_modules/@actions/core/package.json
generated
vendored
|
@ -1,44 +0,0 @@
|
||||||
{
|
|
||||||
"name": "@actions/core",
|
|
||||||
"version": "1.2.4",
|
|
||||||
"description": "Actions core lib",
|
|
||||||
"keywords": [
|
|
||||||
"github",
|
|
||||||
"actions",
|
|
||||||
"core"
|
|
||||||
],
|
|
||||||
"homepage": "https://github.com/actions/toolkit/tree/master/packages/core",
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "lib/core.js",
|
|
||||||
"types": "lib/core.d.ts",
|
|
||||||
"directories": {
|
|
||||||
"lib": "lib",
|
|
||||||
"test": "__tests__"
|
|
||||||
},
|
|
||||||
"files": [
|
|
||||||
"lib"
|
|
||||||
],
|
|
||||||
"publishConfig": {
|
|
||||||
"access": "public"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "git+https://github.com/actions/toolkit.git",
|
|
||||||
"directory": "packages/core"
|
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"audit-moderate": "npm install && npm audit --audit-level=moderate",
|
|
||||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
|
||||||
"tsc": "tsc"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/actions/toolkit/issues"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "^12.0.2"
|
|
||||||
}
|
|
||||||
|
|
||||||
,"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.4.tgz"
|
|
||||||
,"_integrity": "sha512-YJCEq8BE3CdN8+7HPZ/4DxJjk/OkZV2FFIf+DlZTC/4iBlzYCD5yjRR6eiOS5llO11zbRltIRuKAjMKaWTE6cg=="
|
|
||||||
,"_from": "@actions/core@1.2.4"
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue