Customizing Artefact Retention

We’re using Gitlab Self-Hosted, and have noticed that one of our projects is using a large amount of disk space for CI artifact storage.

The cause appears to be because we’ve enabled the Keep artifacts from most recent successful jobs setting for the project, which keeps artifacts from the latest commit on every branch and tag.

Ideally, we’d only keep the artifacts from the latest jobs on some branches, not every individual branch. Is there any way or workaround to achieve this or a similar result? I don’t see anything obvious but maybe there’s something I’m missing.