Skip to content

Instantly share code, notes, and snippets.

@JonathanDagan
JonathanDagan / index.js
Created August 19, 2024 19:29
Gitlab Delete Tags Async Parallel
const GITLAB_URL = "https://gitlab.com"; // Replace with your GitLab instance URL
const PROJECT_ID = "<project_id>"; // Replace with your project ID
const PRIVATE_TOKEN = "<token>"; // Replace with your personal access token (needs api read and write scope)
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
const deleteTag = async (tagName) => {
try {
const response = await fetch(`${GITLAB_URL}/api/v4/projects/${PROJECT_ID}/repository/tags/${tagName}`, {
method: 'DELETE',