From 2a6d64be462549970011e4a5e1c6dc9c666fbca4 Mon Sep 17 00:00:00 2001 From: "Alex Pooley (@zuedev)" Date: Mon, 25 May 2026 09:32:58 +0100 Subject: Add GitLab mirror push support to the repository mirror script --- scripts/push-repo-mirrors.bash | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'scripts') diff --git a/scripts/push-repo-mirrors.bash b/scripts/push-repo-mirrors.bash index 71696a1..04992ed 100644 --- a/scripts/push-repo-mirrors.bash +++ b/scripts/push-repo-mirrors.bash @@ -51,6 +51,19 @@ for repository in /repositories/*; do echo "Pushing to GitHub mirror: $mirror" git push --mirror "https://x-access-token:$GITHUB_TOKEN@$mirror_host" 2>&1 | sed "s/$GITHUB_TOKEN/[REDACTED]/g" || echo "Failed to push to $mirror" ;; + *gitlab.com*) + # do we have a /run/secrets/gitlab_token defined? + if [ ! -f /run/secrets/gitlab_token ]; then + echo "/run/secrets/gitlab_token not found. Skipping push to $mirror." + continue + fi + + GITLAB_TOKEN=$(cat /run/secrets/gitlab_token) + + mirror_host="${mirror#https://}" + echo "Pushing to GitLab mirror: $mirror" + git push --mirror "https://oauth2:$GITLAB_TOKEN@$mirror_host" 2>&1 | sed "s/$GITLAB_TOKEN/[REDACTED]/g" || echo "Failed to push to $mirror" + ;; *codeberg.org*) # do we have a /run/secrets/codeberg_token defined? if [ ! -f /run/secrets/codeberg_token ]; then -- cgit v1.2.3