Skip to content

api_function_addgithubactionsproblemmatcher

hugoalh edited this page Mar 2, 2023 · 5 revisions

Add-GitHubActionsProblemMatcher

  • Type: Function
  • In Version: >= v0.3.0

Description

# Parameter Set: LiteralPath
Add-GitHubActionsProblemMatcher -LiteralPath <String[]>

# Parameter Set: Path (Default)
Add-GitHubActionsProblemMatcher [-Path] <String[]>

Add problem matcher to scan the logs by specified regular expression patterns and automatically surface that information prominently in the user interface, both annotation and log decoration will create when a match is detected. For more information, please visit https://github.com/actions/toolkit/blob/main/docs/problem-matchers.md.

Problem matcher has specified schema:

{
  // {string} An ID field that can be used to remove or replace the problem matcher.
  "owner": "mylint",

  // [Optional] {string} Indicates the default severity, either "warning" or "error", case-insensitive; Default to "error".
  "severity": "error",

  // {object[]} Pattern.
  "pattern": [
    {
      // The regular expression pattern that provides the groups to match against.
      "regexp": "^(.+):\\sline\\s(\\d+),\\scol\\s(\\d+),\\s(Error|Warning|Info)\\s-\\s(.+)\\s\\((.+)\\)$",

      // [Optional] {number} Regular expression group number contain the file name.
      "file": 1,

      // [Optional] {number} Regular expression group number contain a filepath used to root the file (e.g. a project file).
      "fromPath": 2,

      // [Optional] {number} Regular expression group number contain the line number.
      "line": 3,

      // [Optional] {number} Regular expression group number contain the column number.
      "column": 4,

      // [Optional] {number} Regular expression group number contain the severity.
      "severity": 5,

      // [Optional] {number} Regular expression group number contain the error code.
      "code": 6,

      // {number} Regular expression group number contain the error message.
      "message": 7,

      // [Optional] {boolean} Whether to loop until a match is not found, only valid on the last pattern of a multi-pattern matcher.
      "loop": false
    }
  ]
}

Parameter

LiteralPath

<String[]> Literal paths of the JSON problem matcher files.

  • Parameter Set: LiteralPath
  • Position: Named
  • Accept Pipeline Input: True βœ”
  • Accept Pipeline Input By Property Name: True βœ”
  • Accept Wildcard Characters: False ❌
  • Alias:
    • LiteralFile
    • LiteralFiles
    • LiteralPaths
    • LP
    • PSPath
    • PSPaths

Path

<String[]> Paths of the JSON problem matcher files.

  • Parameter Set: Path
  • Position: 0
  • Accept Pipeline Input: True βœ”
  • Accept Pipeline Input By Property Name: True βœ”
  • Accept Wildcard Characters: True βœ”
  • Alias:
    • File
    • Files
    • Paths

Output

<Void>

Guide

API

Enum

Enum Flag

Function

Function Alias

Clone this wiki locally