Skip to content

Instantly share code, notes, and snippets.

@reupen
Created February 17, 2022 21:41
Show Gist options
  • Save reupen/f2320e353554f4fa4d3693fd38c850d4 to your computer and use it in GitHub Desktop.
Save reupen/f2320e353554f4fa4d3693fd38c850d4 to your computer and use it in GitHub Desktop.
Example MSBuild GitHub Actions problem matcher
{
"problemMatcher": [
{
"owner": "reupen-vs2022",
"pattern": [
{
"regexp": "^(?:\\s+\\d>)([\\w\\-:\\\\\\.]+)(?:\\((\\d+),(\\d+)\\)):\\s+(error|warning)\\s(\\w*): ([^\\[\\]]+)\\s\\[.*\\]$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 6,
"code": 5
}
]
}
]
}
@reupen
Copy link
Author

reupen commented Feb 17, 2022

Based on an example message of:

      4>D:\a\columns_ui\columns_ui\pfc\win-objects.cpp(379,20): warning C4996: 'GetVersion': was declared deprecated [D:\a\columns_ui\columns_ui\pfc\pfc.vcxproj]

See https://github.com/actions/toolkit/blob/main/docs/commands.md#problem-matchers and https://github.com/actions/toolkit/blob/master/docs/problem-matchers.md for more details.

A custom logger is a much more flexible solution: https://github.com/reupen/msbuild-github-logger

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment