Start-GitHubRepositoryEvent¶
SYNOPSIS¶
Create a repository dispatch event
SYNTAX¶
__AllParameterSets¶
Start-GitHubRepositoryEvent [-Owner] <string> [-Name] <string> [-EventType] <string>
[[-ClientPayload] <Object>] [[-Context] <Object>] [-WhatIf] [-Confirm] [<CommonParameters>]
ALIASES¶
This cmdlet has the following aliases, {{Insert list of aliases}}
DESCRIPTION¶
You can use this endpoint to trigger a webhook event called repository_dispatch
when you want activity
that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook.
You must configure
your GitHub Actions workflow or GitHub App to run when the repository_dispatch
event occurs.
For an example repository_dispatch
webhook payload, see
"RepositoryDispatchEvent."
The client_payload
parameter is available for any extra information that your workflow might need.
This parameter is a JSON payload that will be passed on when the webhook event is dispatched.
For example,
the client_payload
can include a message that a user would like to send using a GitHub Actions workflow.
Or the client_payload
can be used as a test to debug your workflow.
This endpoint requires write access to the repository by providing either:
- Personal access tokens with
repo
scope. For more information, see "Creating a personal access token for the command line" in the GitHub Help documentation. - GitHub Apps with both
metadata:read
andcontents:read&write
permissions.
This input example shows how you can use the client_payload
as a test to debug your workflow.
EXAMPLES¶
EXAMPLE 1¶
$params = @{
EventType = 'on-demand-test'
ClientPayload = @{
unit = false
integration = true
}
}
Start-GitHubRepositoryEvent @params
Starts a repository event with the name on-demand-test
and a client_payload
that includes unit
and integration
.
PARAMETERS¶
-ClientPayload¶
JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10.
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 3
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: ''
-Context¶
The context to run the command in. Used to get the details for the API call. Can be either a string or a GitHubContext object.
Type: System.Object
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 4
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-EventType¶
A custom webhook event name. Must be 100 characters or fewer.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Name¶
The name of the repository without the .git extension. The name is not case sensitive.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Owner¶
The account owner of the repository. The name is not case sensitive.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases:
- Organization
- User
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
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¶
OUTPUTS¶
NOTES¶
Create a repository dispatch event