Skip to content

Instantly share code, notes, and snippets.

View smashnet's full-sized avatar

Nicolas Inden smashnet

View GitHub Profile
@smashnet
smashnet / gitlab-artifacts-cleanup.py
Last active September 29, 2023 10:34 — forked from Pingu501/gitlab-artifacts-cleanup.py
GitLab Artifacts Clean-Up
"""
This is a small python script to clear up old gitlab build artifacts.
There are 3 variables you should modify:
* base_url: path to your gitlab
* access_token: your personal access token to make gitlab api calls
* delete_everything_older_than: configure the timedelta as you wish
!!IMPORTANT!!
By default this script does only make dry-runs and does not actually delete any files!