From aa6719ed2060bca449a0fc6c67d2a66eac5ad926 Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Wed, 19 Feb 2025 16:19:46 +0100 Subject: [PATCH] docs(core): add how to provide annotation properties --- packages/core/README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/core/README.md b/packages/core/README.md index ac8ced92..1b85e5c8 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -170,6 +170,22 @@ export interface AnnotationProperties { } ``` +Example: + +```js +core.error( + 'This is a bad error seen in file.', + { + title: "Unexecpted Error", + file: "path/to/errored-file.js", + startLine: 1, + endLine: 2, + startColumn: 1, + endColumn: 10, + } +) +``` + #### Styling output Colored output is supported in the Action logs via standard [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code). 3/4 bit, 8 bit and 24 bit colors are all supported. @@ -483,4 +499,4 @@ core.summary.emptyBuffer() // Writes text in the buffer to the summary buffer file and empties the buffer, optionally overwriting all existing content in the summary file with buffer contents. Defaults to false. core.summary.write({overwrite: true}) -``` \ No newline at end of file +```