Git clone

swaleio/[email protected]

Git clone

Clones repository_url into the container-local path given by dest and emits the resolved commit_sha for downstream tasks.

Inputs

Input Required Default Description
repository_url yes — HTTPS URL of the repository.
revision no default branch Branch, tag, or commit to check out.
dest yes — Absolute clone path inside the container. Point it at the mounted workspace (e.g. ${{env.WORKFLOW_STORAGE}}/repo) to share the clone with later tasks, or any other container-local path.
git_token no — Token for private repos (pass a project/account secret).

Outputs

Output Description
commit_sha The resolved HEAD commit SHA.

Compute

CPU. Data movement only — no GPU is needed, and scheduling it on a GPU compute type wastes money.

Example

name: Git clone example
compute_type: cpu-4
entry_point: main

blocks:
  main:
    tasks:
      checkout:
        name: Checkout
        uses: swaleio/git-clone
        args:
          repository_url: https://github.com/acme/app.git
          dest: ${{env.WORKFLOW_STORAGE}}/repo
          git_token: ${{secrets.github_token}}

Downstream tasks read the cloned files at ${{env.WORKFLOW_STORAGE}}/repo and the commit via ${{tasks.checkout.outputs.commit_sha}}.


For the workflow syntax these examples use, see the workflow definition reference in the Swale documentation.

Licensed under the MIT License.