mirror of https://github.com/actions/toolkit
Use ExitCode from @actions/exit
parent
90008fc46b
commit
062a6bb046
|
@ -33,5 +33,8 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^12.0.2"
|
"@types/node": "^12.0.2"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/exit": "^0.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
import * as im from './interfaces'
|
import {ExitCode} from '@actions/exit'
|
||||||
import * as intm from './internal'
|
import * as intm from './internal'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// Variables
|
// Variables
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
|
@ -50,7 +58,7 @@ export function getInput(name: string, options?: im.InputOptions): string {
|
||||||
* Sets the action status to neutral
|
* Sets the action status to neutral
|
||||||
*/
|
*/
|
||||||
export function setNeutral() {
|
export function setNeutral() {
|
||||||
process.exitCode = im.ExitCode.Neutral
|
process.exitCode = ExitCode.Neutral
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -59,7 +67,7 @@ export function setNeutral() {
|
||||||
* @param message add error issue message
|
* @param message add error issue message
|
||||||
*/
|
*/
|
||||||
export function setFailed(message: string) {
|
export function setFailed(message: string) {
|
||||||
process.exitCode = im.ExitCode.Failure
|
process.exitCode = ExitCode.Failure
|
||||||
error(message)
|
error(message)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
/**
|
|
||||||
* The code to exit an action
|
|
||||||
*/
|
|
||||||
export 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
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 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
|
|
||||||
}
|
|
Loading…
Reference in New Issue