Files
ClawSkills/claw-skills/scripts/promote-improvements

30 lines
603 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
WORKSPACE="${AGENT_WORKSPACE:-}"
if [[ -z "$WORKSPACE" ]]; then
echo "Error: AGENT_WORKSPACE not set"
exit 1
fi
cd "$WORKSPACE"
# Get agent name from ego-mgr
AGENT_NAME=$(ego-mgr get name)
if [[ -z "$AGENT_NAME" ]]; then
echo "Error: failed to get agent name"
exit 1
fi
BRANCH_NAME="$AGENT_NAME"
# Checkout new branch based on agent name
echo "Creating and checking out branch: $BRANCH_NAME"
git checkout -b "$BRANCH_NAME"
# Force push to the new branch
echo "Force pushing to origin/$BRANCH_NAME"
git push origin "$BRANCH_NAME" --force
echo "Done."