Excel Add-In for GitHub

Build 24.0.9060

UploadFile

Upload a file to a repository.

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 Description
Path String The file path, relative to the repository root.
Repository String The repository to download the file from.
OwnerLogin String The owner of the repository.
Branch String The branch to download the file from. Defaults to 'main'.

The default value is main.

CommitMessage String The commit message for the file upload.
SHA String The file hash, used to update existing files.
CommitterName String The name of the person that committed the file. Default: the authenticated user.
CommitterEmail String The email of the person that committed the file. Default: the authenticated user.
AuthorName String The name of the author that committed the file. Default: the committer or the authenticated user if you omit committer.
AuthorEmail String The email of the author that committed the file. Default: the committer or the authenticated user if you omit committer.
LocalPath String The absolute path where the file data is read from.
FileData String Base64 string representation of the file content. Only used if LocalPath and InputStream are not set.

Result Set Columns

Name Type Description
Success Boolean Indicates whether or not the operation executed successfully.
Details String Any extra details on the operation's execution.
CommitSHA String The commit hash.
FileSHA String The file node hash.

Copyright (c) 2024 CData Software, Inc. - All rights reserved.
Build 24.0.9060