GitLabAliases.

GitLabRepositoryDownloadFileAsync(ICakeContext, string, string, ProjectId, string, string, FilePath) Method

Summary

Downloads a file from a GitLab-hosted repository
Assembly
Cake.GitLab.dll
Namespace
Cake.GitLab
Containing Type
GitLabAliases

Syntax

public static Task GitLabRepositoryDownloadFileAsync(this ICakeContext context, string serverUrl, string accessToken, ProjectId project, string filePath, string ref, FilePath destination)

Examples

[TaskName("Download-File")] public class DownloadRepositoryFileTask : AsyncFrostingTask { public override async Task RunAsync(ICakeContext context) { await context.GitLabRepositoryDownloadFileAsync( "https://gitlab.com", "ACCESSTOKEN" "owner/repository", "README.md", "main", "downloaded/README.md" ); } }

Attributes

Type Description
NullableContextAttribute
AsyncStateMachineAttribute
CakeMethodAliasAttribute
CakeAliasCategoryAttribute

Parameters

Name Type Description
context ICakeContext The current Cake context.
serverUrl string The url of the GitLab server
accessToken string The access token for authenticating to the GitLab server
project ProjectId The path (name and namespace) or id of the project to get the file from.
filePath string The path of the file to download (as relative path within the repository).
ref string The name of the branch, a git tag or commit specifying the version of the file to get.
destination FilePath The path to save the file's content to.

Return Value

Type Description
Task