ADO.NET Provider for GitHub

Build 25.0.9434

UploadFile

Enables users to upload files directly to a specified GitHub repository for collaborative purposes.

Sample

The 'Path' parameter is required, and must be relative to the repository root without a preceding '/'.

EXECUTE  [Information].[UploadFile] Repository = 'HelloGit', Path = 'testFileUploadFromProcedure.txt', LocalPath = 'C:/Users/CData/Desktop/project/file.txt', CommitMessage = 'test'

EXECUTE  [Information].[UploadFile] Repository = 'HelloGit', Path = 'src/Main.java', FileData = 'aGVsbG8gd29ybGQh', CommitMessage = 'test', Branch = 'master', CommitterName = 'CData', CommitterEmail = '[email protected]', AuthorName = 'CDataSupport', AuthorEmail = '[email protected]'

Set SHA to replace an existing file.

EXECUTE  [UploadFile] Repository = 'HelloGit', Path = 'src/Main.java', FileData = 'aGVsbG8gd29ybGQh', CommitMessage = 'test', SHA = 'bc7774a7b18deb1d7bd0212d34246a9b1260ae17'

Input

Name Type Accepts Output Streams Description
Path String False The file path relative to the repository root where the file will be uploaded.
Repository String False The name of the repository where the file will be uploaded.
OwnerLogin String False The login (username) of the owner of the repository.
Branch String False The branch to which the file will be uploaded. Defaults to 'main' if not specified.

The default value is main.

CommitMessage String False The commit message describing the changes made by the file upload.
SHA String False The hash of the file, used to update existing files. Required if the file already exists.
CommitterName String False The name of the person committing the file. Defaults to the authenticated user if not specified.
CommitterEmail String False The email of the person committing the file. Defaults to the authenticated user if not specified.
AuthorName String False The name of the author of the file upload. Defaults to the committer or the authenticated user if not specified.
AuthorEmail String False The email of the author of the file upload. Defaults to the committer or the authenticated user if not specified.
LocalPath String False The absolute file path on the local system from which the file data is read.
InputStream Binary True An input stream instance used to read the file data. Only used if LocalPath is not provided.
FileData String False A Base64-encoded string representation of the file content. Used if both LocalPath and InputStream are not provided.

Result Set Columns

Name Type Description
Success Boolean Indicates whether the file upload operation was successful.
Details String Additional details about the execution of the file upload operation.
CommitSHA String The unique hash of the commit created by the file upload.
FileSHA String The unique hash of the uploaded file node.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434