Creating annotations from build output
GitHub Actions can interpret specific strings in your workflow’s log output and automatically generate annotations. These annotations can provide visual feedback directly on pull requests or commits, making it easier for developers to understand what went wrong or what might need attention.
To create annotations based on log output, you can use specific formats recognized by GitHub Actions. Let’s look at some examples of these formats:
error
:::error file=FILE_NAME,line=LINE_NUMBER,col=COLUMN_NUMBER::MESSAGE_HERE
warning
:::warning file=FILE_NAME,line=LINE_NUMBER,col=COLUMN_NUMBER::MESSAGE_HERE
debug
:::debug::MESSAGE_HERE
info
:::info::MESSAGE_HERE
Let’s break down the terms used here:
FILE_NAME
is the relative path to the fileLINE_NUMBER
is the line number in the fileCOLUMN_NUMBER
is the column number in the file (this is optional)MESSAGE_HERE
is the message you want to display...