[sysadmin-bin] Fetch unarchived repositories under gitlab.g.o/Archive and turn them into archived
- From: Andrea Veri <averi src gnome org>
- To: gnome-sysadmin gnome org,commits-list gnome org
- Subject: [sysadmin-bin] Fetch unarchived repositories under gitlab.g.o/Archive and turn them into archived
- Date: Tue, 18 May 2021 12:59:00 +0000 (UTC)
commit 29b3799263005621fd581e896a1dbe56f964b58a
Author: Andrea Veri <averi redhat com>
Date: Tue May 18 14:58:49 2021 +0200
Fetch unarchived repositories under gitlab.g.o/Archive and turn them into archived
gitlab/archive-group.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
---
diff --git a/gitlab/archive-group.py b/gitlab/archive-group.py
new file mode 100644
index 0000000..954a94a
--- /dev/null
+++ b/gitlab/archive-group.py
@@ -0,0 +1,14 @@
+#!/usr/bin/python3
+
+import gitlab
+
+GROUP_ID = 4001
+
+gl = gitlab.Gitlab('https://gitlab.gnome.org', GITLAB_PRIVATE_RW_TOKEN, api_version=4)
+
+g = gl.groups.get(GROUP_ID)
+p = g.projects.list(archived=False)
+
+for project in p:
+ proj = gl.projects.get(project.id)
+ proj.archive()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]