mirror of
https://github.com/DrewThomasson/ebook2audiobook.git
synced 2026-01-08 21:38:12 -05:00
Fixing PR testing from other fork branches
This commit is contained in:
13
.github/workflows/Docker-Build.yml
vendored
13
.github/workflows/Docker-Build.yml
vendored
@@ -35,6 +35,7 @@ jobs:
|
||||
BASE_REF="${{ github.event.pull_request.base.ref }}"
|
||||
HEAD_REF="${{ github.event.pull_request.head.ref }}"
|
||||
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
|
||||
HEAD_REPO_URL="${{ github.event.pull_request.head.repo.clone_url }}"
|
||||
TRIGGER_SHA="${{ github.sha }}"
|
||||
FRESH_CLONE=0
|
||||
|
||||
@@ -66,9 +67,17 @@ jobs:
|
||||
if [ "$IS_PR" = "true" ]; then
|
||||
echo "==> PR detected: simulating GitHub merge (base: $BASE_REF ← head: $HEAD_REF)"
|
||||
|
||||
# Fetch both branches
|
||||
# Fetch both branches. For the head, we must fetch from the actual source repo (fork)
|
||||
# because 'origin' might not have the fork's branch.
|
||||
git fetch origin "$BASE_REF":"origin/$BASE_REF"
|
||||
git fetch origin "$HEAD_REF":"origin/$HEAD_REF"
|
||||
|
||||
if [ -n "$HEAD_REPO_URL" ]; then
|
||||
echo "==> Fetching head from fork: $HEAD_REPO_URL"
|
||||
git fetch "$HEAD_REPO_URL" "$HEAD_REF":refs/remotes/origin/$HEAD_REF
|
||||
else
|
||||
# Fallback (shouldn't happen for PRs)
|
||||
git fetch origin "$HEAD_REF":"origin/$HEAD_REF"
|
||||
fi
|
||||
|
||||
# Reset to base branch
|
||||
git checkout -B "$BASE_REF" "remotes/origin/$BASE_REF"
|
||||
|
||||
13
.github/workflows/E2A-Test.yml
vendored
13
.github/workflows/E2A-Test.yml
vendored
@@ -95,6 +95,7 @@ jobs:
|
||||
BASE_REF="${{ github.event.pull_request.base.ref }}"
|
||||
HEAD_REF="${{ github.event.pull_request.head.ref }}"
|
||||
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
|
||||
HEAD_REPO_URL="${{ github.event.pull_request.head.repo.clone_url }}"
|
||||
TRIGGER_SHA="${{ github.sha }}"
|
||||
FRESH_CLONE=0
|
||||
|
||||
@@ -126,9 +127,17 @@ jobs:
|
||||
if [ "$IS_PR" = "true" ]; then
|
||||
echo "==> PR detected: simulating GitHub merge (base: $BASE_REF ← head: $HEAD_REF)"
|
||||
|
||||
# Fetch both branches
|
||||
# Fetch both branches. For the head, we must fetch from the actual source repo (fork)
|
||||
# because 'origin' might not have the fork's branch.
|
||||
git fetch origin "$BASE_REF":"origin/$BASE_REF"
|
||||
git fetch origin "$HEAD_REF":"origin/$HEAD_REF"
|
||||
|
||||
if [ -n "$HEAD_REPO_URL" ]; then
|
||||
echo "==> Fetching head from fork: $HEAD_REPO_URL"
|
||||
git fetch "$HEAD_REPO_URL" "$HEAD_REF":refs/remotes/origin/$HEAD_REF
|
||||
else
|
||||
# Fallback (shouldn't happen for PRs)
|
||||
git fetch origin "$HEAD_REF":"origin/$HEAD_REF"
|
||||
fi
|
||||
|
||||
# Reset to base branch
|
||||
git checkout -B "$BASE_REF" "remotes/origin/$BASE_REF"
|
||||
|
||||
Reference in New Issue
Block a user