From 1a36cbc3cfcb10af19715b5322cc38661dc61076 Mon Sep 17 00:00:00 2001 From: Christian Gunderman Date: Thu, 14 May 2026 19:21:15 -0700 Subject: [PATCH] fix(ci): fallback to default branch name if bot branch name is invalid --- .github/workflows/gemini-cli-bot-brain.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gemini-cli-bot-brain.yml b/.github/workflows/gemini-cli-bot-brain.yml index 8939b026ca..fb89069a18 100644 --- a/.github/workflows/gemini-cli-bot-brain.yml +++ b/.github/workflows/gemini-cli-bot-brain.yml @@ -338,7 +338,10 @@ jobs: BRANCH_NAME="bot/productivity-updates-$(date +'%Y%m%d%H%M%S')-${{ github.run_id }}" if [ -f "${{ runner.temp }}/brain-data/branch-name.txt" ]; then - BRANCH_NAME=$(cat "${{ runner.temp }}/brain-data/branch-name.txt") + FILE_BRANCH=$(cat "${{ runner.temp }}/brain-data/branch-name.txt" | tr -d '[:space:]') + if [ -n "$FILE_BRANCH" ] && [ "$FILE_BRANCH" != "bot/" ]; then + BRANCH_NAME="$FILE_BRANCH" + fi fi if [[ ! "$BRANCH_NAME" =~ ^bot/ ]]; then