mirror of
https://git.mirrors.martin98.com/https://github.com/actions/toolkit
synced 2026-04-01 19:43:20 +08:00
Add additional optional param to core.error
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# @actions/core Releases
|
||||
|
||||
### 1.12.0
|
||||
- Adds optional functionality to `core.error` to allow for the logging of stack traces.
|
||||
|
||||
### 1.11.1
|
||||
- Fix uses of `crypto.randomUUID` on Node 18 and earlier [#1842](https://github.com/actions/toolkit/pull/1842)
|
||||
|
||||
|
||||
4
packages/core/package-lock.json
generated
4
packages/core/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@actions/core",
|
||||
"version": "1.11.1",
|
||||
"version": "1.12.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@actions/core",
|
||||
"version": "1.11.1",
|
||||
"version": "1.12.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/exec": "^1.1.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@actions/core",
|
||||
"version": "1.11.1",
|
||||
"version": "1.12.0",
|
||||
"description": "Actions core lib",
|
||||
"keywords": [
|
||||
"github",
|
||||
|
||||
@@ -70,6 +70,13 @@ export interface AnnotationProperties {
|
||||
endColumn?: number
|
||||
}
|
||||
|
||||
export interface ErrorMessageProperties {
|
||||
/**
|
||||
* Whether to include the stack trace in the error message. Defaults to false.
|
||||
*/
|
||||
withStackTrace?: boolean
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// Variables
|
||||
//-----------------------------------------------------------------------
|
||||
@@ -274,12 +281,16 @@ export function debug(message: string): void {
|
||||
*/
|
||||
export function error(
|
||||
message: string | Error,
|
||||
properties: AnnotationProperties = {}
|
||||
properties: AnnotationProperties & ErrorMessageProperties = {}
|
||||
): void {
|
||||
if (typeof message === 'string') {
|
||||
issueCommand('error', toCommandProperties(properties), message)
|
||||
return
|
||||
}
|
||||
issueCommand(
|
||||
'error',
|
||||
toCommandProperties(properties),
|
||||
message instanceof Error ? message.toString() : message
|
||||
properties.withStackTrace ? message.stack : message.toString()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user