#!/bin/bash

# SPDX-FileCopyrightText: The LineageOS Project
# SPDX-License-Identifier: Apache-2.0

set -u

ORG="$1"
BRANCHES="${@:2}"

for repo in $(gh repo list "${ORG}" -L 99999 --json name | jq ".[].name" --raw-output); do
    for branch in $BRANCHES; do
        gh repo edit "${ORG}/${repo}" --default-branch "${branch}"
    done
done
