1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/// A structure to describe the output of a file annotation.
#[derive(Debug, Default)]
pub struct FileAnnotation {
/// The severity level of the annotation.
pub severity: AnnotationLevel,
/// The 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.
pub path: String,
/// 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.
pub start_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::path`] is blank.
pub end_line: 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.
pub start_column: Option<usize>,
/// The column number where the annotation ends (1-based).
///
/// This is ignored if
/// - the [`Self::start_line`] and [`Self::end_line`] are not provided
/// - the [`Self::end_line`] is less than or equal to [`Self::start_line`]
/// - the [`Self::start_column`] is provided but is not less than this [`Self::end_column`]
/// - the [`Self::path`] is blank
pub end_column: Option<usize>,
/// The title of the annotation, which will be shown in the Git Server's UI.
pub title: Option<String>,
/// The 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.
pub message: String,
}
#[derive(Debug, Default)]
pub enum AnnotationLevel {
Debug,
#[default]
Notice,
Warning,
Error,
}