Repository navigation
ConvertTo‑ShpAnnotation
Converts a structured finding into a CI annotation command.
ConvertTo-ShpAnnotation [-InputObject] <Object> [[-PropertyMap] <Hashtable>] [[-Format] <String>] [-Emit]
[-Summary] [<CommonParameters>]
Accepts a ShellPilot result or a plain finding object from the pipeline and returns a GitHub Actions, Azure DevOps, or readable text annotation. A ShellPilot result is unwrapped through its ContentObject member. If ContentObject is an array, one annotation is produced per finding.
Finding properties are read case-insensitively. By default the cmdlet reads Level, Path, Line, Column, Title, and Message. PropertyMap changes the source property for any of those canonical names, for example @{ Level = 'severity'; Message = 'detail' }.
Error, Warning, and Notice are recognized without regard to case. GitHub Actions supports all three. Azure DevOps accepts only error and warning, so Notice becomes warning there. Every missing or unknown level also becomes warning; malformed model output must not create an error annotation by accident.
Without Format, GITHUB_ACTIONS is checked first, then TF_BUILD. If neither variable is set, Text is used. Strings are returned by default. Emit writes each annotation to the host stream instead.
$schema = @{
type = 'object'
required = @('Level', 'Message')
properties = @{
Level = @{ type = 'string' }
Path = @{ type = 'string' }
Line = @{ type = 'integer' }
Column = @{ type = 'integer' }
Title = @{ type = 'string' }
Message = @{ type = 'string' }
}
} | ConvertTo-Json -Depth 5 -Compress
Invoke-Shp -Prompt 'Review the staged changes.' -JsonSchema $schema | ConvertTo-ShpAnnotation -Emit
Requests one structured finding, unwraps ContentObject from the ShellPilot result, auto-detects the CI vendor, and emits the annotation.
$map = @{ Level = 'severity'; Path = 'file'; Message = 'detail' }
$findings | ConvertTo-ShpAnnotation -PropertyMap $map -Format Text
Formats objects from a caller-specific schema as readable text.
Writes each formatted annotation to the host stream instead of returning it to the success stream.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseGitHubActions, AzureDevOps, or Text. When omitted, a non-empty GITHUB_ACTIONS variable selects GitHubActions; otherwise a non-empty TF_BUILD variable selects AzureDevOps; otherwise Text is used.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseA ShellPilot.Result or a plain object containing one finding. Accepts pipeline input. A ShellPilot result's ContentObject may contain one finding or an array of findings.
Type: Object
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseMaps canonical finding names to property names in the input schema. Unspecified entries retain their defaults. For example, @{ Level = 'severity'; Path = 'file'; Message = 'detail' }.
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: 2
Default value: @{}
Accept pipeline input: False
Accept wildcard characters: FalseAppends the findings as a Markdown table to the file named by GITHUB_STEP_SUMMARY when that environment variable is set.
Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands
https://learn.microsoft.com/azure/devops/pipelines/scripts/logging-commands
- Clear-ShpChat
- Clear-ShpContext
- Clear-ShpRedactionPolicy
- Clear-ShpToolPolicy
- Clear-ShpUsage
- Compress-ShpChat
- ConvertTo-ShpAnnotation
- ConvertTo-ShpOtelTrace
- ConvertTo-ShpTokenCount
- Get-ShpChat
- Get-ShpChatCheckpoint
- Get-ShpContext
- Get-ShpContextReport
- Get-ShpCosineSimilarity
- Get-ShpCostEstimate
- Get-ShpDefault
- Get-ShpMcpServer
- Get-ShpModel
- Get-ShpModelName
- Get-ShpRedactionPolicy
- Get-ShpTool
- Get-ShpToolPolicy
- Get-ShpUsage
- Initialize-Shp
- Invoke-Shp
- Invoke-ShpBatch
- Invoke-ShpEval
- Invoke-ShpSubagent
- Register-ShpMcpServer
- Register-ShpTool
- Request-ShpEmbedding
- Resolve-ShpError
- Restore-ShpChat
- Save-ShpChat
- Select-ShpModel
- Set-ShpContext
- Set-ShpRedactionPolicy
- Set-ShpToolPolicy
- Start-ShpChat
- Test-ShpCiReadiness
- Unregister-ShpMcpServer
- Unregister-ShpTool