pub struct FileAnnotation {
pub severity: AnnotationLevel,
pub path: String,
pub start_line: Option<usize>,
pub end_line: Option<usize>,
pub start_column: Option<usize>,
pub end_column: Option<usize>,
pub title: Option<String>,
pub message: String,
}Expand description
A structure to describe the output of a file annotation.
Fields§
§severity: AnnotationLevelThe severity level of the annotation.
path: StringThe path to the file being annotated.
This is relative to the repository root.
It should not start with a leading slash (not ./).
It should only use posix-style path separators (/), even on Windows runners.
On Github, this can be left blank if the annotation is to be specific to the workflow run.
start_line: Option<usize>The line number where the annotation starts (1-based).
If not provided, the annotation will be scoped to the entire file (and Self::end_line will be ignored).
This is ignored if Self::path is blank.
end_line: Option<usize>The line number where the annotation ends (1-based).
If not provided, the annotation will be placed at the specified Self::start_line instead.
This is ignored if
Self::pathis blank.Self::start_lineis not provided.Self::end_lineis not greater thanSelf::start_line.
start_column: Option<usize>The column number where the annotation starts (1-based).
This is ignored if the Self::start_line is not provided, or if Self::path is blank.
end_column: Option<usize>The column number where the annotation ends (1-based).
This is ignored if
- the
Self::pathis blank - the
Self::start_lineis not provided - the
Self::end_lineis not greater than toSelf::start_lineandSelf::start_columnis provided but is not less than thisSelf::end_column
title: Option<String>The title of the annotation, which will be shown in the Git Server’s UI.
message: StringThe message of the annotation, which will be shown in the Git Server’s UI.
This shall not contain any line breaks. Some Git Servers may support a limited set of markdown syntax, but this is not guaranteed.
Implementations§
Source§impl FileAnnotation
impl FileAnnotation
Sourcepub fn fmt_github(&self) -> String
Available on crate feature github only.
pub fn fmt_github(&self) -> String
github only.Format the FileAnnotation struct into the specific string format compatible with Github Actions.
See Github workflow commands documentation.
Example:
::notice file={name},line={line},col={col},endLine={endLine},endColumn={endColumn},title={title}::{message}