Archive
The archive actions create, extract, and list archive files inside a step. They do not need tar, zip, or unzip on the host, and they print a JSON summary to stdout.
Use them instead of shell archive commands in run: steps. To keep files from a run for download in the Web UI, use Artifact.
| Action | Does | Required fields |
|---|---|---|
archive.create | Pack a file or directory into an archive | source, destination |
archive.extract | Unpack an archive into a directory | source |
archive.list | Report the entries of an archive | source |
Basic Usage
working_dir: .
steps:
- id: pack
action: archive.create
with:
source: ./reports
destination: ./out/reports.tar.gz
- id: unpack
depends: pack
action: archive.extract
with:
source: ./out/reports.tar.gz
destination: ./restorepack stores the directory as reports/... inside reports.tar.gz and prints:
{
"operation": "create",
"source": "./reports",
"destination": "./out/reports.tar.gz",
"filesAdded": 4,
"bytesArchived": 244,
"duration": "33.466666ms",
"verifyPerformed": false
}unpack recreates restore/reports/.... Relative paths resolve against the step working directory, which is a fresh per-run directory unless working_dir is set, and missing parent directories of destination are created.
Create an Archive
The format comes from format when set, otherwise from the destination extension. format wins even when the extension disagrees.
working_dir: .
steps:
- id: bundle
action: archive.create
with:
source: ./dist
destination: ./release/dist.tgz
exclude:
- "**/*.map"
compression_level: 9
verify_integrity: true- A directory
sourceis stored under its own name, such asdist/app.js. Asourceof.stores the directory's contents at the archive root. includeandexcludematch the path stored in the archive, such asdist/assets/app.js.compression_levelapplies to gzip and bzip2 only, from 1 to 9.verify_integrityreads the new archive back once and fails the step if it cannot be read.- Symbolic links are stored as links.
follow_symlinks: truestores the files they point to.
Extract an Archive
The format is detected from the file content and name. Set format to skip detection.
working_dir: .
steps:
- id: unpack_csv
action: archive.extract
with:
source: ./incoming/dataset.tar.zst
destination: ./data
include:
- "**/*.csv"
strip_components: 1
overwrite: truestrip_components removes leading directories from each entry; preserve_paths: false keeps only the file name:
Archive entry strip_components: 1 preserve_paths: false
export/2026/jan.csv -> 2026/jan.csv jan.csv
export/readme.txt -> readme.txt readme.txt- Without
destination, files go to the step working directory. - Without
overwrite: true, the step fails when a file it would write already exists. includeandexcludematch the path afterstrip_componentsandpreserve_pathsapply. Skipped entries are counted infilesSkipped.continue_on_error: truerecords a failing entry inerrors, writes a warning to stderr, and continues with the next entry.
Path Safety
An entry whose path would land outside destination, such as ../escape.txt, fails the step with escapes destination. Symbolic links are checked the same way: an absolute link target, or one that leads outside destination through links in the archive or already on disk, fails the step. Links that stay inside destination are extracted. Entries written before the failure are not rolled back.
Password-Protected Archives
password opens encrypted 7z and RAR archives for archive.extract and archive.list. It is ignored for zip and tar formats, and archive.create with a password fails. Creating encrypted archives is not supported.
working_dir: .
secrets:
- name: ARCHIVE_PASSWORD
provider: env
key: ARCHIVE_PASSWORD
steps:
- id: unpack_secure
action: archive.extract
with:
source: ./secure-data.7z
destination: ./decrypted
password: ${env.ARCHIVE_PASSWORD}List an Archive
archive.list reads the archive without extracting it. include and exclude filter the entries it reports.
working_dir: .
steps:
- id: inspect
action: archive.list
with:
source: ./out/reports.tar.gz
include:
- "**/*.csv"
output:
csv_count:
from: stdout
decode: json
select: .totalFiles
- id: report
run: echo "CSV files in archive ${steps.inspect.outputs.csv_count}"{
"operation": "list",
"source": "./out/reports.tar.gz",
"totalFiles": 1,
"totalSize": 14,
"files": [
{
"path": "reports/2026/jan.csv",
"size": 14,
"mode": "-rw-r--r--",
"modTime": "2026-12-04T06:34:00Z",
"isDir": false
}
],
"verified": false,
"duration": "735.958µs"
}The object form of output publishes fields of this JSON as named outputs.
Formats
| Format | Names and extensions | Create | Extract and list |
|---|---|---|---|
| ZIP | zip | Yes | Yes |
| TAR | tar | Yes | Yes |
| TAR + gzip | tar.gz, tgz | Yes | Yes |
| TAR + bzip2 | tar.bz2, tbz2, tbz | Yes | Yes |
| TAR + xz | tar.xz, txz | Yes | Yes |
| TAR + Zstandard | tar.zst, tar.zstd | Yes | Yes |
| 7-Zip | 7z | No | Yes, with password |
| RAR | rar | No | Yes, with password |
Single compressed files (.gz, .bz2, .xz, .zst, .lz4) are not archives: create and extract fail on them. Use a TAR-based format.
Configuration
| Field | Actions | Required | Default | Description |
|---|---|---|---|---|
source | All | Yes | Archive to read, or file or directory to pack. | |
destination | create, extract | For create | Working directory (extract) | Archive to write, or directory to extract into. |
format | All | No | Detected | Format name from Formats. |
compression_level | create | No | -1 | 1 to 9 for gzip and bzip2. -1 or 0 uses the library default. |
include | All | No | All entries | Glob patterns (** crosses directories). An entry must match one. |
exclude | All | No | None | Glob patterns. A matching entry is skipped, even when included. |
overwrite | extract | No | false | Replace existing files. |
strip_components | extract | No | 0 | Leading path segments to remove. Zero or greater. |
preserve_paths | extract | No | true | false writes every file at the top of destination. |
follow_symlinks | create | No | false | Store link targets instead of links. |
verify_integrity | All | No | false | Read the whole archive once and fail if it is unreadable. |
continue_on_error | extract | No | false | Record per-entry errors and continue. |
dry_run | create, extract | No | false | Count what would be written without writing archive or file contents. |
password | extract, list | No | None | Password for 7z and RAR archives. |
verbose | All | No | false | Accepted; has no effect. |
Every field accepts references such as ${params.name} and ${steps.id.outputs.name}.
Output
Each action prints one JSON object to stdout:
| Action | Fields |
|---|---|
create | operation, source, destination, filesAdded, bytesArchived, duration, verifyPerformed, errors |
extract | operation, source, destination, filesExtracted, bytesExtracted, filesSkipped, duration, verifyPerformed, errors |
list | operation, source, totalFiles, totalSize, files, verified, duration |
source and destination are printed as written in the step. errors appears only when continue_on_error recorded one. filesAdded counts directory entries as well as files.
Errors
Validation rejects a missing source, a negative strip_components, and unknown fields. A misspelled field gets a suggestion, such as did you mean "overwrite".
These fail when the step runs:
archive.createwithoutdestination(unlessdry_run), or withpassword.archive.createwhose format cannot be inferred:could not infer format; specify config.format.- A
sourcethat does not exist:source not found. - An existing file without
overwrite:exists (overwrite disabled).
The exit code tells the failure class, so continue_on.exit_code can act on it:
| Exit code | Failure |
|---|---|
| 2 | Invalid configuration found at run time, such as an archive.extract source that is a directory |
| 3 | Source not found |
| 4 | Destination error, such as an existing file without overwrite |
| 5 | Format not detected or not supported |
| 6 | Extraction failed, including an entry that escapes destination |
| 7 | Creation failed |
| 10 | Permission denied |
| 12 | Archive unreadable during verify_integrity |
| 14 | Cancelled |
| 1 | Any other failure |

