mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-10 22:41:14 +00:00
fix: update roomotes.yml to checkout PR branch before running translation check
This commit is contained in:
parent
836371c36a
commit
21e86824b7
1 changed files with 25 additions and 2 deletions
|
|
@ -1,8 +1,31 @@
|
|||
version: "1.0"
|
||||
|
||||
commands:
|
||||
- name: Pull latest changes
|
||||
run: git pull
|
||||
- name: Fetch and checkout PR branch
|
||||
run: |
|
||||
# Try to get PR info from various possible environment variables
|
||||
if [ -n "$GITHUB_HEAD_REF" ]; then
|
||||
echo "Checking out PR branch: $GITHUB_HEAD_REF"
|
||||
git fetch origin "$GITHUB_HEAD_REF"
|
||||
git checkout -B "$GITHUB_HEAD_REF" "origin/$GITHUB_HEAD_REF"
|
||||
elif [ -n "$GITHUB_REF" ] && [[ "$GITHUB_REF" =~ ^refs/pull/([0-9]+)/ ]]; then
|
||||
PR_NUMBER="${BASH_REMATCH[1]}"
|
||||
echo "Fetching PR #$PR_NUMBER"
|
||||
git fetch origin "pull/$PR_NUMBER/head:pr-$PR_NUMBER"
|
||||
git checkout "pr-$PR_NUMBER"
|
||||
elif [ -n "$GITHUB_EVENT_PATH" ] && [ -f "$GITHUB_EVENT_PATH" ]; then
|
||||
# Try to extract PR number from GitHub event JSON
|
||||
PR_NUMBER=$(jq -r '.pull_request.number // .number // empty' "$GITHUB_EVENT_PATH" 2>/dev/null)
|
||||
if [ -n "$PR_NUMBER" ]; then
|
||||
echo "Fetching PR #$PR_NUMBER from event data"
|
||||
git fetch origin "pull/$PR_NUMBER/head:pr-$PR_NUMBER"
|
||||
git checkout "pr-$PR_NUMBER"
|
||||
else
|
||||
echo "Could not determine PR number from event data"
|
||||
fi
|
||||
else
|
||||
echo "No PR information found in environment, using current branch"
|
||||
fi
|
||||
timeout: 60
|
||||
execution_phase: task_run
|
||||
- name: Install dependencies
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue