aboutsummaryrefslogtreecommitdiff
path: root/scripts/push-repo-mirrors.bash
diff options
context:
space:
mode:
authorAlex Pooley (@zuedev) <zuedev@gmail.com>2026-05-25 09:27:58 +0100
committerAlex Pooley (@zuedev) <zuedev@gmail.com>2026-05-25 09:27:58 +0100
commit403afe25b793480f95f5e74e3047283a0dacaedc (patch)
treea208730c2484f0f20ef37fc68f2d20c4d9294087 /scripts/push-repo-mirrors.bash
parent29f6d5716af3fceb1d26ec392d03410842dc9995 (diff)
downloadgit.zue.dev-403afe25b793480f95f5e74e3047283a0dacaedc.tar
git.zue.dev-403afe25b793480f95f5e74e3047283a0dacaedc.tar.gz
git.zue.dev-403afe25b793480f95f5e74e3047283a0dacaedc.tar.bz2
git.zue.dev-403afe25b793480f95f5e74e3047283a0dacaedc.tar.xz
git.zue.dev-403afe25b793480f95f5e74e3047283a0dacaedc.zip
Add Codeberg token support for repository mirror pushes
Diffstat (limited to 'scripts/push-repo-mirrors.bash')
-rw-r--r--scripts/push-repo-mirrors.bash13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/push-repo-mirrors.bash b/scripts/push-repo-mirrors.bash
index bc0ac1e..71696a1 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"
;;
+ *codeberg.org*)
+ # do we have a /run/secrets/codeberg_token defined?
+ if [ ! -f /run/secrets/codeberg_token ]; then
+ echo "/run/secrets/codeberg_token not found. Skipping push to $mirror."
+ continue
+ fi
+
+ CODEBERG_TOKEN=$(cat /run/secrets/codeberg_token)
+
+ mirror_host="${mirror#https://}"
+ echo "Pushing to Codeberg mirror: $mirror"
+ git push --mirror "https://x-access-token:$CODEBERG_TOKEN@$mirror_host" 2>&1 | sed "s/$CODEBERG_TOKEN/[REDACTED]/g" || echo "Failed to push to $mirror"
+ ;;
*)
echo "Unknown mirror type: $mirror. Skipping."
;;