New-GitHubCheck
SYNOPSIS
Create a check run
SYNTAX
Default (Default)
New-GitHubCheck [-Owner] <string> [-Repo] <string> -Name <string> -HeadSha <string>
[-DetailsUrl <string>] [-ExternalId <string>] [-Status <string>] [-StartedAt <string>]
[-Conclusion <string>] [-CompletedAt <string>] [-Output <Object>] [-Actions <Object[]>]
[-Accept <string>] [-WhatIf] [-Confirm]
Body
New-GitHubCheck [-Owner] <string> [-Repo] <string> -Body <Object> [-Name <string>]
[-HeadSha <string>] [-DetailsUrl <string>] [-ExternalId <string>] [-Status <string>]
[-StartedAt <string>] [-Conclusion <string>] [-CompletedAt <string>] [-Output <Object>]
[-Actions <Object[]>] [-Accept <string>] [-WhatIf] [-Confirm]
ALIASES
This cmdlet has the following aliases,
- Get-GHNewCheck
DESCRIPTION
The New-GitHubCheck cmdlet invokes the POST method of the /repos/{owner}/{repo}/check-runs endpoint (Create a check run)
Creates a new check run for a specific commit in a repository.
To create a check run, you must use a GitHub App. OAuth apps and authenticated users are not able to create a check suite.
In a check suite, GitHub limits the number of check runs with the same name to 1000. Once these check runs exceed 1000, GitHub will start to automatically delete older check runs. [!NOTE] The Checks API only looks for pushes in the repository where the check suite or check run were created. Pushes to a branch in a forked repository are not detected and return an empty ‘pull_requests’ array.
Endpoint: POST /repos/{owner}/{repo}/check-runs API version: 2026-03-10
EXAMPLES
EXAMPLE 1
New-GitHubCheck -Owner 'octocat' -Repo 'Hello-World' -Name 'mighty_readme' -HeadSha 'ce587453ced02b1526dfb4cb910479d431683101' -Body @{ key = 'value' }
Invokes POST /repos/{owner}/{repo}/check-runs
EXAMPLE 2
New-GitHubCheck -Owner 'octocat' -Repo 'Hello-World' -Body @{ name = 'mighty_readme' }
Sends the request body from a hashtable, parameters override the keys of -Body
PARAMETERS
-Accept
The Accept header (media type) of the request Default value: application/vnd.github+json
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Actions
Displays a button on GitHub that can be clicked to alert your app to do additional tasks. For example, a code linting app can display a button that automatically fixes detected errors. The button created in this object is displayed after the check run completes. When a user clicks the button, GitHub sends the ‘check_run.requested_action’ webhook (https://docs.github.com/webhooks/event-payloads/#check_run) to your app. Each action includes a ‘label’, ‘identifier’ and ‘description’. A maximum of three actions are accepted. To learn more about check runs and requested actions, see “Check runs and requested actions (https://docs.github.com/rest/guides/using-the-rest-api-to-interact-with-checks#check-runs-and-requested-actions).”
Type: System.Object[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Body
The whole request body as a hashtable or object. Keys that are also available as parameters are overwritten by the parameter values
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Body
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-CompletedAt
The time the check completed. This is a timestamp in ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) format: ‘YYYY-MM-DDTHH:MM:SSZ’.
Body property [ completed_at ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Conclusion
Required if you provide ‘completed_at’ or a ‘status’ of ‘completed’. The final conclusion of the check. Note: Providing ‘conclusion’ will automatically set the ‘status’ parameter to ‘completed’. You cannot change a check run conclusion to ‘stale’, only GitHub can set this.
Allowed values: ‘action_required’, ‘cancelled’, ‘failure’, ‘neutral’, ‘success’, ‘skipped’, ‘stale’, ‘timed_out’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-DetailsUrl
The URL of the integrator’s site that has the full details of the check. If the integrator does not provide this, then the homepage of the GitHub app is used.
Body property [ details_url ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-ExternalId
A reference for the run on the integrator’s system.
Body property [ external_id ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-HeadSha
The SHA of the commit.
Required unless -Body is used
Body property [ head_sha ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Body
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
- Name: Default
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Name
The name of the check. For example, “code-coverage”.
Required unless -Body is used
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Body
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
- Name: Default
Position: Named
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Output
Check runs can accept a variety of data in the ‘output’ object, including a ‘title’ and ‘summary’ and can optionally provide descriptive details about the run.
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Owner
The account owner of the repository. The name is not case sensitive.
Path parameter [ owner ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Repo
The name of the repository without the ‘.git’ extension. The name is not case sensitive.
Path parameter [ repo ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-StartedAt
The time that the check run began. This is a timestamp in ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) format: ‘YYYY-MM-DDTHH:MM:SSZ’.
Body property [ started_at ]
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Status
The current status of the check run. Only GitHub Actions can set a status of ‘waiting’, ‘pending’, or ‘requested’.
Default value: queued
Allowed values: ‘queued’, ‘in_progress’, ‘completed’, ‘waiting’, ‘requested’, ‘pending’
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-WhatIf
Runs the command in a mode that only reports what would happen without performing the actions.
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
Objects with properties named like the path parameters can be piped to this function
{{ Fill in the Description }}
System.String
{{ Fill in the Description }}
OUTPUTS
The response of the GitHub API (objects
{{ Fill in the Description }}
NOTES
OperationId: checks/create Category: checks / runs