aboutsummaryrefslogtreecommitdiff
path: root/scripts/push-repo-mirrors.bash
diff options
context:
space:
mode:
authorAlex Pooley (@zuedev) <zuedev@gmail.com>2026-05-07 23:51:39 +0100
committerAlex Pooley (@zuedev) <zuedev@gmail.com>2026-05-07 23:51:39 +0100
commit1ff967c107f4e46f246ca9c0a8fa1af51d31fa79 (patch)
treead8d52972b4cc89189c155ec0a485bf2c9bd5fbb /scripts/push-repo-mirrors.bash
parent9cbcafa4b82f0ecb038ca2881ee505c84ec3b847 (diff)
downloadgit.zue.dev-1ff967c107f4e46f246ca9c0a8fa1af51d31fa79.tar
git.zue.dev-1ff967c107f4e46f246ca9c0a8fa1af51d31fa79.tar.gz
git.zue.dev-1ff967c107f4e46f246ca9c0a8fa1af51d31fa79.tar.bz2
git.zue.dev-1ff967c107f4e46f246ca9c0a8fa1af51d31fa79.tar.xz
git.zue.dev-1ff967c107f4e46f246ca9c0a8fa1af51d31fa79.zip
Revert default branch update and curl changes
Diffstat (limited to 'scripts/push-repo-mirrors.bash')
-rw-r--r--scripts/push-repo-mirrors.bash17
1 files changed, 0 insertions, 17 deletions
diff --git a/scripts/push-repo-mirrors.bash b/scripts/push-repo-mirrors.bash
index 48cc076..bc0ac1e 100644
--- a/scripts/push-repo-mirrors.bash
+++ b/scripts/push-repo-mirrors.bash
@@ -48,23 +48,6 @@ for repository in /repositories/*; do
GITHUB_TOKEN=$(cat /run/secrets/github_token)
mirror_host="${mirror#https://}"
-
- # Update the GitHub repo's default branch to match the local HEAD before mirroring,
- # so that --mirror can delete any branch that was previously the default.
- local_default=$(git symbolic-ref --short HEAD 2>/dev/null)
- github_repo="${mirror#https://github.com/}"
- if [ -n "$local_default" ]; then
- echo "Setting GitHub default branch to '$local_default' for $github_repo"
- if ! curl -sf -X PATCH \
- -H "Authorization: Bearer $GITHUB_TOKEN" \
- -H "Accept: application/vnd.github+json" \
- -d "{\"default_branch\":\"$local_default\"}" \
- "https://api.github.com/repos/$github_repo" > /dev/null; then
- echo "Error: failed to update default branch on GitHub for $github_repo. Skipping push."
- continue
- fi
- fi
-
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"
;;