diff options
| -rw-r--r-- | Dockerfile.debian | 1 | ||||
| -rw-r--r-- | scripts/push-repo-mirrors.bash | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/Dockerfile.debian b/Dockerfile.debian index 8bd71de..9455f93 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -8,6 +8,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ openssh-server \ git \ cron \ + curl \ jq \ ca-certificates \ && rm -rf /var/lib/apt/lists/* diff --git a/scripts/push-repo-mirrors.bash b/scripts/push-repo-mirrors.bash index 5058134..48cc076 100644 --- a/scripts/push-repo-mirrors.bash +++ b/scripts/push-repo-mirrors.bash @@ -55,12 +55,14 @@ for repository in /repositories/*; do github_repo="${mirror#https://github.com/}" if [ -n "$local_default" ]; then echo "Setting GitHub default branch to '$local_default' for $github_repo" - curl -sf -X PATCH \ + 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 \ - || echo "Warning: failed to update default branch on GitHub for $github_repo" + "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" |
