Artifacts - Keep last X instances

Description

It would be really nice if the CI artifacts capabilities included the option of keeping some defined number of recent bundles.

Proposal

job: artifacts: when: on_success historic_count: ?

Where historic_count is the number of archives you would like to keep. For instance, if the value is 1 gitlab would always keep the last successful build. A historic_count of 5 would keep the last 5 successful builds, and if the limit was reached a the new artifact would cause the auto-removal the oldest archive bundle.

Use cases

Projects where the artifacts are large. Projects where artifacts are constantly generated due to rapid changes.

Assignee Loading
Time tracking Loading