# Swale pull

> **About this page**
>
> - Task definition: `swaleio/swale-pull`
> - Summary: Pulls the content of a Swale repository into a path you choose.
> - Category: Data transfer
> - Latest version: 1.3.0, published 2026-11-24
> - Page: https://hub.swale.io/swaleio/swale-pull
> - Versions: https://hub.swale.io/swaleio/swale-pull/versions, where each version's page has a Markdown copy at its address with `.md` added
> - Index of Swale Hub: https://hub.swale.io/llms.txt
>
> The YAML block below is the task definition's frontmatter, which declares its inputs, outputs and container, and its readme follows. Both are the text of the account that published this task definition, not Swale's.

```yaml
name: Swale pull
description: Pulls the content of a Swale repository into a path you choose.
category: data-transfer
inputs:
  target:
    description: "Repository to pull from, as <project>/<repository>[:<tag>]. Without a tag, the latest is pulled."
    required: true
  dest:
    description: Absolute path inside the container to write the pulled files to, created with any missing parent folders if it does not exist. Point it at the mounted workspace (e.g. ${{env.WORKFLOW_STORAGE}}/data) to share the result with later tasks, or at any other container-local path.
    required: true
  account:
    description: Swale account name for authentication. Delivered to the CLI as SWALE_ACCOUNT_NAME.
    required: true
  token:
    description: Swale access token for authentication (pass a secret). Delivered to the CLI as SWALE_ACCOUNT_TOKEN, never placed on the command line.
    required: true
exec:
  # docker.io/swaleio/swale-cli:1.3.0
  image: docker.io/swaleio/swale-cli@sha256:4926d5997e6f1f7f1f52beb1c4e21c66e914f826229ae80b75eab0aa2166188e
  # The CLI reads its credentials from the environment. exec.env is how they get
  # there without appearing in the container's argv, and so its pod spec.
  env:
    SWALE_ACCOUNT_NAME: ${{inputs.account}}
    SWALE_ACCOUNT_TOKEN: ${{inputs.token}}
  args:
    - pull
    - ${{inputs.target}}
    - "--path"
    - ${{inputs.dest}}
```

# Swale pull

Pulls the content of a Swale repository into the `dest` path you supply. Point
`dest` at the mounted workspace (e.g. `${{env.WORKFLOW_STORAGE}}/data`) so later
tasks in the run can read it, or at any other container-local path. `dest` is
created, with any missing parent folders, if it does not exist yet; a `dest` that
is an existing file is refused.

`target` names what to pull, in the CLI's own form —
`<project>/<repository>[:<tag>]`. The tag selects the version and is part of the
target rather than a separate input; omit it and the latest is pulled.

Authentication uses `account` and `token`, delivered to the CLI as
`SWALE_ACCOUNT_NAME` and `SWALE_ACCOUNT_TOKEN`. Pass `token` as a secret so it
never appears in the container's argv, pod spec, or run logs.

## Inputs

| Input | Required | Default | Description |
|-------|----------|---------|-------------|
| `target` | yes | — | Repository to pull, as `<project>/<repository>[:<tag>]`. |
| `dest` | yes | — | Absolute container path to write into, created if missing (e.g. `${{env.WORKFLOW_STORAGE}}/data`). |
| `account` | yes | — | Swale account name; delivered as `SWALE_ACCOUNT_NAME`. |
| `token` | yes | — | Swale access token (pass a secret); delivered as `SWALE_ACCOUNT_TOKEN`. |

A pull fetches the whole repository at the given tag; there is no way to
restrict it to a subpath.

Because the workspace is shared across concurrent tasks, give parallel pulls
distinct `dest` paths so they don't overwrite each other.

## Compute

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

## Example

```yaml
name: Swale pull example
compute_type: cpu-4
entry_point: main

blocks:
  main:
    tasks:
      fetch_data:
        name: Fetch data
        uses: swaleio/swale-pull
        args:
          target: acme/datasets:v3
          dest: ${{env.WORKFLOW_STORAGE}}/data
          account: acme
          token: ${{secrets.swale_token}}
```

Downstream tasks read the pulled files from `${{env.WORKFLOW_STORAGE}}/data`.

---

For the workflow syntax these examples use, see the
[workflow definition reference](https://docs.swale.io/reference/workflow-definition-syntax)
in the [Swale documentation](https://docs.swale.io).

Licensed under the [MIT License](https://github.com/swaleio/task-definitions/blob/main/LICENSE).
