Add-GitHubReleaseAsset¶
SYNOPSIS¶
Upload a release asset
SYNTAX¶
__AllParameterSets¶
Add-GitHubReleaseAsset [-Owner] <string> [-Repository] <string> [-Tag] <string> [[-Name] <string>]
[[-Label] <string>] [-Path] <string> [[-ContentType] <string>] [[-Context] <Object>]
[<CommonParameters>]
ALIASES¶
This cmdlet has the following aliases, {{Insert list of aliases}}
DESCRIPTION¶
This endpoint makes use of a Hypermedia relation
to determine which URL to access.
The endpoint you call to upload release assets is specific to your release.
Use the
upload_url returned in
the response of the Create a release endpoint to upload
a release asset.
You need to use an HTTP client which supports SNI to make calls to this endpoint.
Most libraries will set the required Content-Length header automatically.
Use the required Content-Type header to provide
the media type of the asset.
For a list of media types, see
Media Types.
For example:
application/zip
GitHub expects the asset data in its raw binary form, rather than JSON. You will send the raw binary content of the asset as the request body. Everything else about the endpoint is the same as the rest of the API. For example, you'll still need to pass your authentication to be able to upload an asset.
When an upstream failure occurs, you will receive a 502 Bad Gateway status.
This may leave an empty asset with a state
of starter.
It can be safely deleted.
Notes:
* GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods.
The "List release assets"
endpoint lists the renamed filenames.
For more information and help, contact
GitHub Support.
* To find the release_id query the
GET /repos/{owner}/{repo}/releases/latest endpoint.
* If you upload an asset with the same filename as another uploaded asset, you'll receive an error and must delete
the old file before you can re-upload the new asset.
EXAMPLES¶
EXAMPLE 1¶
Add-GitHubReleaseAsset -Owner 'octocat' -Repository 'hello-world' -ID '7654321' -Path 'C:\Users\octocat\Downloads\hello-world.zip'
Gets the release assets for the release with the ID '1234567' for the repository 'octocat/hello-world'.
EXAMPLE 2¶
Add-GitHubReleaseAsset -Owner 'octocat' -Repository 'hello-world' -ID '7654321' -Path 'C:\Users\octocat\Projects\MyApp'
Automatically creates a ZIP file from the contents of the MyApp directory and uploads it as a release asset.
PARAMETERS¶
-ContentType¶
The 'Content-Type' for the payload.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 6
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: 7
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Label¶
An alternate short description of the asset. Used in place of the filename.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 4
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Name¶
The name of the file asset.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 3
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.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases:
- Organization
- User
ParameterSets:
- Name: (All)
Position: 0
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Path¶
The path to the asset file.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases:
- FullName
ParameterSets:
- Name: (All)
Position: 5
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Repository¶
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: true
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-Tag¶
The name of the tag to get a release from.
Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
Position: 2
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: true
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¶
GitHubRelease¶
{{ Fill in the Description }}
System.String¶
{{ Fill in the Description }}
OUTPUTS¶
GitHubReleaseAsset¶
{{ Fill in the Description }}