artifact
The artifact step type publishes, pulls, copies, inspects, lists, searches, deletes, signs, verifies, and reads documents of versioned artifacts from a workflow, a custom command, an embedded script, or a lifecycle hook. It runs the same operations as atmos artifacts, in process, and returns the same typed result. No shelling out to the CLI.
workflows:
publish-vpc:
steps:
- name: publish-vpc
type: artifact
action: publish
source: ./components/terraform/vpc
repository: shared
artifact_name: components/terraform/vpc
artifact_kind: component/terraform
version: "1.2.0"
metadata:
labels:
team: platform
Run the step as a component lifecycle hook through the generic kind: step hook bridge. The hook's with: block holds the same flat fields:
hooks:
backup-output:
events: [after.terraform.apply]
kind: step
type: artifact
on_failure: fail
with:
action: publish
source: ./dist
repository: backups
artifact_name: backups/app
version: build-123
Repositories are defined under artifacts.repositories in atmos.yaml. See the artifacts configuration reference.
Fields
The step's own name, output, and artifacts keep their usual meaning (the step name, the output display mode, and the expected-output declaration). The artifact's identity is artifact_name and artifact_kind.
action- Required. One of
publish,pull,copy,inspect,list,search,delete,sign,verify, orshow. Each action accepts only its own fields below. An unknown action, a field the action does not accept, or a missing required field fails validation before anything runs. repository- The configured repository alias. Required by every action except
copy,list, andsearch. A step never picks a default repository.listandsearchaccept a comma-separated list and default to every configured repository. Supports Go templates. sourcepublishonly. The file or directory to publish. It must be a plain string path, even though other step types accept a map here. A relative path resolves against the step'sworking_directory. Supports Go templates.artifact_namepublish: the artifact name. When omitted, the name comes from the producer metadata, then the source basename.list: restrict the listing to one name, which is the positional[name]argument ofatmos artifacts list. Forpublish, this is the--nameflag of the CLI. Supports Go templates.versionpublish. The explicit version. There is no generated version and no implicitlatest; a publication fails when neither this field nor the producer supplies one. Supports Go templates.artifact_kindpublish. The artifact kind. Defaults tofiles. This is the--kindflag of the CLI. Supports Go templates.forcepublish,pull,copy. Replace conflicting state. Force never bypasses signature verification or immutable release formats.dry_runpublish. Validate and plan the publication without writing anything. A workflow-level--dry-runhas the same effect onpublish, and skipspull,copy,delete, andsign.metadata.labelspublish. Exact key/value labels attached to the published version. Values support Go templates.readme,changelogpublish. The document paths. A relative path resolves against the publish source directory, exactly like--readmeand--changelog.refpull,copy,inspect,sign,verify,delete,show. The artifact reference,name:versionorname@sha256:<digest>.signaccepts a digest reference only. Supports Go templates.destinationpull. The output directory (the--outputflag of the CLI). A relative path resolves against the step'sworking_directory. Supports Go templates.from,tocopy. The source and destination repository aliases.documentshow. Eitherreadmeorchangelog.querysearch. The search text, a string. It matches names, kinds, descriptions, and labels.labelslist,search. Exact key/value selectors, as a comma-separatedkey=valuestring, a list of them, or a mapping. Every selector must match.refreshlist,search. Bypass the cached discovery snapshots.
Fields by action
| Action | Required | Optional |
|---|---|---|
publish | source, repository | artifact_name, version, artifact_kind, force, dry_run, metadata.labels, readme, changelog |
pull | ref, repository, destination | force |
copy | ref, from, to | force |
inspect, sign, verify, delete | ref, repository | none |
show | document, ref, repository | none |
list | none | artifact_name, repository, labels, refresh |
search | none | query, repository, labels, refresh |
Result
The typed result is stored under metadata.artifact. It is the payload that atmos artifacts <command> --format=json prints, with the same field names. For list and search the payload is an object whose artifacts array holds the entries, also available as metadata.artifacts.
Single-artifact actions also set these named string outputs. A value the operation did not produce is omitted, never filled with an empty string.
{{ .steps.<name>.outputs.ref }}- The resolved reference.
{{ .steps.<name>.outputs.location }}- The primary resolved storage location.
{{ .steps.<name>.outputs.resolved_digest }},record_digest,content_digest,representation_digest- The digests the operation resolved. Each is labeled by what it covers: the manifest or record the repository resolved, the portable record, the content, and the transferred representation.
{{ .steps.<name>.outputs.size }}- The transferred or described payload size in bytes.
{{ .steps.<name>.outputs.outcome }}created,unchanged,replaced,deleted,read,dry-run, orfailed.{{ .steps.<name>.value }}- The resolved reference, or the number of entries for
listandsearch.
A failed operation still returns its partial result: the operation identity, the outcome failed, the error text, and whatever the service resolved before it failed.
steps:
- name: publish
type: artifact
action: publish
source: ./dist
repository: backups
artifact_name: builds/app
version: build-123
- name: verify
type: artifact
action: verify
repository: backups
ref: "{{ .steps.publish.outputs.ref }}"
CI reports
A workflow, custom command, embedded script, or hook that runs artifact steps writes one CI report when it ends, even when it failed. The report has one section per operation, ordered by where each step was scheduled: sequential steps in order, and the branches of a parallel group in branch order, whatever order they finish in. Every attempt of a retried step is one operation, and the report shows the final attempt.
The named outputs are also written as CI output variables when ci.output.enabled is on: artifact_<output> carries the last operation in the report, and artifact_<step>_<output> carries the last operation of the step with that name, with every character other than a letter or digit in the step name replaced by an underscore. A hook adds nothing to its own output, so the report is never rendered twice.
Retries, failure, and cancellation
Set retry: to retry the whole operation. A publication keeps its operation identity and its captured preparation time across every attempt, so the creation time and the report of a retried publication do not change on every attempt, and the final attempt reports the outcome.
The artifact service also retries a temporary transfer failure by itself, after it has proved that nothing was committed. When a step sets retry:, the service makes a single attempt per call, so the two budgets never multiply: retry.max_attempts is the total number of attempts. Without retry:, the service keeps its own small transport retry budget.
timeout: limits each attempt. continue: and a hook's on_failure apply to the failed step as usual. Canceling the workflow cancels the operation in flight and stops further attempts.