GitHub Repositories DownloadArchive

GitHub Repositories DownloadArchive

Certified

Download a repository archive

Downloads a GitHub repository archive for a commit SHA, branch or tag and streams it to Kestra internal storage. When ref is omitted, the repository default branch is used. The token needs the contents: read permission. It is optional for public repositories, which are then subject to GitHub's anonymous rate limit.

yaml
type: io.kestra.plugin.github.repositories.DownloadArchive

Download a commit archive with a GitHub App installation token.

yaml
id: github_download_archive
namespace: company.team

tasks:
  - id: github_app_token
    type: io.kestra.plugin.github.auth.AppToken
    clientId: "{{ secret('GITHUB_APP_CLIENT_ID') }}"
    installationId: "52068731"
    privateKey: "{{ secret('GITHUB_APP_PRIVATE_KEY') }}"

  - id: download_archive
    type: io.kestra.plugin.github.repositories.DownloadArchive
    appInstallationToken: "{{ outputs.github_app_token.token }}"
    repository: kestra-io/kestra
    ref: a1b2c3d4e5f6789012345678901234567890abcd
    format: TAR_GZ

  - id: log_archive
    type: io.kestra.plugin.core.log.Log
    message: "Stored {{ outputs.download_archive.ref }} archive at {{ outputs.download_archive.uri }} ({{ outputs.download_archive.size }} bytes)"

Download a branch or tag as a zip archive.

yaml
id: github_download_zip
namespace: company.team

tasks:
  - id: download_archive
    type: io.kestra.plugin.github.repositories.DownloadArchive
    oauthToken: "{{ secret('GITHUB_ACCESS_TOKEN') }}"
    repository: kestra-io/kestra
    ref: develop
    format: ZIP
Properties

Target repository

Repository in owner/repo format to download.

GitHub App installation token

Installation access token generated by a GitHub App. Use this for repository-scoped app access instead of a user token.

Assets this task consumes as inputs or produces as outputs, for lineage tracking and the asset graph (Enterprise Edition). A flow declaring this property on a task is rejected in the open-source edition.

Definitions
assetFailureBehaviorstring
Possible Values
IGNOREFAILWARN

Asset failure behavior

Behavior applied to the task state when a declared asset fails to render, emit, or be persisted (e.g. a lock conflict): FAIL escalates it to FAILED, WARN (default) warns it if it would otherwise succeed, IGNORE leaves the state untouched.

enableAutobooleanstring

Whether to auto-register assets referenced dynamically at runtime that are not statically declared in inputs or outputs.

inputsarray

The assets consumed as inputs.

id*string
Min length1
typestring
outputs

The assets produced as outputs.

id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*object
descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150
id*string
Min length1
Max length150
type*string
Min length1

Custom asset type

descriptionstring
displayNamestring
metadataobject
Default{}
namespacestring
Min length1
Max length150

GitHub API endpoint

GitHub or GitHub Enterprise API base URL such as https://api.github.com or https://ghe.acme.com/api/v3. Set this when targeting GitHub Enterprise or a non-default API endpoint.

DefaultZIP
Possible Values
TAR_GZZIP

Archive format

ZIP stores a zipball as .zip. TAR_GZ stores GitHub's gzip-compressed tarball as .tar.gz. Defaults to ZIP.

GitHub JWT token

GitHub App JWT used for app-level authentication. Use this when the task should authenticate as the app rather than a user.

GitHub login

GitHub login used with oauthToken for authenticated requests. Leave unset when authenticating with jwtToken or appInstallationToken.

GitHub OAuth token

GitHub personal access token used for authenticated requests. Can be used alone or with login.

Git ref

Branch, tag or commit SHA to archive. Defaults to the repository default branch when unset.

Resolved ref

Branch, tag or commit SHA that was archived. The repository default branch when ref is omitted.

Archive size

Size of the stored archive in bytes.

Formaturi

Archive URI

Kestra internal storage URI of the downloaded archive.