ADO.NET Provider for GitHub

Build 24.0.9175

UploadFile

Allows uploading files to a repository for storage, collaboration, or integration into the project.

Sample

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

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

Alternatively, set the connection property Schema to the desired repository.

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

EXECUTE  [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 relative file path within the repository where the file is uploaded.
Branch String False The branch to which the file is uploaded. This defaults to 'main' if no branch is specified.

デフォルト値はmainです。

CommitMessage String False The message describing the changes made during the file upload.
SHA String False The hash of the file, used to verify and update existing files in the repository.
CommitterName String False The name of the person committing the file. This defaults to the authenticated user if one is not provided.
CommitterEmail String False The email address of the person committing the file. This defaults to the authenticated user's email address if no email address is provided.
AuthorName String False The name of the original author of the file being committed. This defaults to the committer's name or the authenticated user if the name is omitted.
AuthorEmail String False The email address of the original author of the file being committed. This defaults to the committer's email or the authenticated user's email if the email address is omitted.
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. This is used only if LocalPath is not provided.
FileData String False The Base64-encoded string representation of the file's content. This is used only if LocalPath and InputStream are not provided.

Result Set Columns

Name Type Description
Success Boolean A Boolean value indicating whether the file upload operation was successful.
Details String Additional details about the execution of the file upload operation, such as errors or status messages.
CommitSHA String The hash of the commit that includes the uploaded file.
FileSHA String The hash of the uploaded file node within the repository.

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