Import Repository Files
The 'Import Repository Files' task in the GitHub library will create new and update existing files in your repository based on the XML data provided in your input file.
See the end of the article for a breakdown and example of the XML format required for this task.
Note
The repository provided in your XML data must already exist in GitHub. This task will not create a new repository in GitHub.
Settings
Connection Settings
Connection
Required
The GitHub connection to use.
See the Connecting to GitHub article for how to set up a connection to GitHub.
File Settings
Fail File
Required
For any records that you provide that are not successfully imported into GitHub, they will be written to this file along with an error message.
Input File
Required
The file containing the records you wish to import into GitHub.
Success File
Required
For any records that you provide that are successfully imported into GitHub, they will be written to this file.
XML
Repository Details
XML Field | Required? | Notes |
---|---|---|
ExternalID | Optional | A unique identifier for Zynk to track processed records. |
Owner | Optional | If the repository you are updating is not owned by the user in your connection, specify the username of the repository owner here. |
Name | Required | The title of the GitHub repository that you want to update. |
LocalDirectory | Optional | If provided, the local directory will be used in conjunction with the given file names. For example, if this is set to C:\zynk-process and you provide a file the name example.md , the full path will be C:\zynk-process\example.md |
Files | Required | The collection of files to process. |
<?xml version="1.0" encoding="utf-8"?>
<Repository>
<ExternalID>1</ExternalID>
<Owner>zynksoftware</Owner>
<Name>samples</Name>
<LocalDirectory>C:\samples</LocalDirectory>
<Files />
</Repository>
File Details
XML Field | Required? | Notes |
---|---|---|
ExternalID | Optional | A unique identifier for Zynk to track processed records. |
Operation | Optional | The options are Create , Update and Upsert . If not provided, the operation will default to Upsert. |
CommitMessage | Required | The message to reference the file commit in GitHub. |
Name | Required | The path to the local file on your PC or server. |
GitHubName | Optional | This field is used if you would like to specify a specific path to the file on GitHub. |
Base64Content | Optional | If the file does not exist on the local PC, you must provide a base64 encoded string of the file contents. |
<?xml version="1.0" encoding="utf-8"?>
<Files>
<ExternalID>1</ExternalID>
<Operation>Create</Operation> <!-- Other options are Update and Upsert. -->
<CommitMessage>This is an example commit.</CommitMessage>
<Name>example.md</Name>
<GitHubName>github-example.md</GitHubName>
<Base64Content />
</Files>
Example
<?xml version="1.0" encoding="utf-8"?>
<Repositories>
<Repository>
<Name>zynk-process</Name>
<LocalDirectory>C:\zynk-process</LocalDirectory>
<Files>
<File>
<CommitMessage>This is an example commit via zynk-workflow</CommitMessage>
<Name>example.md</Name>
</File>
<File>
<CommitMessage>This is another example commit via zynk-workflow</CommitMessage>
<Name>example-1.md</Name>
</File>
<File>
<CommitMessage>This is yet another example commit via zynk-workflow</CommitMessage>
<Name>example.md</Name>
<GitHubName>example/example.md</GitHubName>
</File>
</Files>
</Repository>
<Repository>
<Owner>zynksoftware</Owner>
<Name>samples</Name>
<Files>
<File>
<Operation>Create</Operation>
<CommitMessage>Example commit.</CommitMessage>
<Name>C:\samples\example.md</Name>
</File>
<File>
<Operation>Create</Operation>
<CommitMessage>Another example commit.</CommitMessage>
<Name>C:\samples\example-1.md</Name>
</File>
</Files>
</Repository>
</Repositories>