Cleanup and retention
The Artifact Cleanup action deletes artifact versions based on artifact name and version name patterns. All versions matching the configured patterns are deleted during action execution.
Individual versions can also be deleted manually on the Versions tab or using the bdy artifact version delete command. Both methods require the Manage permission level in the Artifacts module. See Versions.
Artifact Cleanup action
Each row in the action configuration contains two fields: Artifact name pattern and Version name pattern. Additional rows can be added using the + button. Both fields support the * wildcard. For example, build-* matches all version names beginning with build-.
Image loading...
In YAML, the form rows are the artifacts list:
- pipeline: cleanup-builds
name: Clean up build versions
refs:
- refs/heads/main
actions:
- action: Delete build versions
type: ARTIFACT_CLEANUP
artifacts:
- artifact: my-app-build
version: build-*
Each deleted version has its own entry in the action log:
Deleting artifact version: my-app-build:build-3
Image loading...
The artifacts list can have several items, for example old builds of one artifact and test versions of another. Fields shared by all actions, such as trigger_time and retry_count, are described in the action YAML reference.
* pattern matches all version names, including release versions. To limit deletion to temporary versions, use a dedicated version name prefix, such as build- or pr-, and a corresponding wildcard pattern. The build-* pattern does not match the latest version.
Required permissions
The Artifact Cleanup action requires the Manage level for the pipeline. Read-write is not enough, even though it allows publishing versions.
A pipeline without the Manage level fails the action with this message:
Pipeline is not allowed to manage artifact: my-app-build
Open the artifact's Permissions tab, in the Pipeline section add the cleanup pipeline with the + button and set it to Manage. Do not raise the All pipelines row to Manage if only one pipeline should delete versions.
Image loading...
When to run the cleanup
The Artifact Cleanup action can sit in a separate pipeline or at the end of the pipeline that publishes versions:
- Separate pipeline on a schedule - a pipeline with only the Cleanup action that runs periodically, for example once a week. Scheduling is described in On schedule.
- Cleanup after a release - the pipeline publishes a release version, for example
3.2.0, and at the end deletes thebuild-*versions used for testing.
Before the first run, check in the Versions tab which versions match the pattern.
Configure retention rules
You set retention rules in the artifact's Settings tab, in the Retention section. A rule consists of a version name pattern and one of these options:
- Keep all versions - nothing is deleted,
- Keep the most recent - the number of newest versions to keep,
- Keep versions from the last - the period from which versions are kept.
Image loading...
The Settings tab is available to a user whose role has the Manage level in the Artifacts module. In the REST API, the rules are the artifact's retention_rules field (Artifacts API).
Storage and billing
Artifact storage is billed per GB-hour. Storage usage is listed as Artifact GB-hours on the Billing tab in workspace settings. For current storage rates, see Usage and GB-minutes.
See also:
- Versions - deleting and copying versions manually
- Artifacts in pipelines - Publish Artifact Version and Download Artifact Version actions
- Permissions and access - Deny, Read-only, Read-write and Manage levels
- On artifact event - triggers started by version changes
Last modified on Dec 2, 2026