mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2025-08-11 04:40:00 +08:00
Use ExitCode from @actions/exit
This commit is contained in:
parent
90008fc46b
commit
062a6bb046
@ -33,5 +33,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@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'
|
||||
|
||||
/**
|
||||
* 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
|
||||
//-----------------------------------------------------------------------
|
||||
@ -50,7 +58,7 @@ export function getInput(name: string, options?: im.InputOptions): string {
|
||||
* Sets the action status to neutral
|
||||
*/
|
||||
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
|
||||
*/
|
||||
export function setFailed(message: string) {
|
||||
process.exitCode = im.ExitCode.Failure
|
||||
process.exitCode = ExitCode.Failure
|
||||
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…
x
Reference in New Issue
Block a user