diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 96b884a..3c31f8f 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -2,7 +2,10 @@ "permissions": { "allow": [ "Bash(but --help:*)", - "Bash(but rub --help:*)" + "Bash(but rub --help:*)", + "WebSearch", + "WebFetch(domain:docs.gitea.com)", + "WebFetch(domain:gitea.com)" ] } } diff --git a/.gitea/workflows/Release.yml b/.gitea/workflows/Release.yml index 6dce6f8..52efc19 100644 --- a/.gitea/workflows/Release.yml +++ b/.gitea/workflows/Release.yml @@ -100,6 +100,22 @@ jobs: "${API_URL}/pulls?state=open" | jq '[.[] | select(.head.ref == "next-release")]') PR_INDEX=$(echo "${PRS}" | jq -r '.[0].number // empty') + # If PR exists, rebase the branch onto the latest base branch + if [ -n "${PR_INDEX}" ]; then + echo "Rebasing PR #${PR_INDEX} branch onto ${BASE_BRANCH}..." + REBASE_RESPONSE=$(curl -s -w "\n%{http_code}" -X POST \ + -H "Authorization: token ${TOKEN}" \ + "${API_URL}/pulls/${PR_INDEX}/update?style=rebase") + REBASE_CODE=$(echo "${REBASE_RESPONSE}" | tail -1) + if [ "${REBASE_CODE}" = "200" ]; then + echo "Successfully rebased branch onto ${BASE_BRANCH}" + elif [ "${REBASE_CODE}" = "409" ]; then + echo "Branch already up to date or rebase conflict - continuing with update" + else + echo "Warning: Rebase returned ${REBASE_CODE}, continuing anyway" + fi + fi + echo "Checking for existing next-release branch..." BRANCH_CHECK=$(curl -s -w "%{http_code}" -o /dev/null \ -H "Authorization: token ${TOKEN}" \