Skip to content

Commit

Permalink
+96
Browse files Browse the repository at this point in the history
  • Loading branch information
SunSerega committed Aug 18, 2024
1 parent ebd5776 commit 04a53af
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/upstream pretest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -187,19 +187,28 @@ jobs:
$fork_main_branch_name = 'custom'
$fork_branch_name = "pretest/$pr_num"
if (&{ git show-ref --verify -q "refs/remotes/origin/$fork_branch_name"; $? }) {
Write-Host "Branch for PR $pr_num exists. Merging with ${fork_main_branch_name}:"
Write-Host "Branch for PR $pr_num exists"
git checkout $fork_branch_name
git merge $fork_main_branch_name
Write-Host "Merging latest commits from PR $pr_num"
git merge "remotes/0_official/pull/$pr_num/head"
if (-not $?) { throw "git merge failed" }
git push
if (-not $?) { throw "git push failed" }
} else {
Write-Host "Branch for PR $pr_num doesn't exist. Creating:"
Write-Host "Branch for PR $pr_num doesn't exist"
git checkout "remotes/0_official/pull/$pr_num/head"
Write-Host "Creating:"
git checkout -b $fork_branch_name
git push --set-upstream origin $fork_branch_name
if (-not $?) { throw "git push failed" }
}
Write-Host "Merging latest commits from PR $pr_num"
git merge "remotes/0_official/pull/$pr_num/head"
Write-Host "Merging with ${fork_main_branch_name}:"
git merge $fork_main_branch_name
if (-not $?) { throw "git merge failed" }
git push
if (-not $?) { throw "git push failed" }
Expand All @@ -212,7 +221,6 @@ jobs:
Push-Location './POCGL'
git fetch --all 2>&1 | Out-Null
# $core_main_branch_name = '${{ github.head_ref || github.ref_name }}'
$core_main_branch_name = '${{ github.event.repository.default_branch }}'
$core_branch_name = "subm-pretest/$org_repo/$pr_num"
if (&{ git show-ref --verify -q "refs/remotes/origin/$core_branch_name"; $? }) {
Expand Down Expand Up @@ -288,7 +296,6 @@ jobs:
New-Item -ItemType Directory -Path $main_repo_dir | Out-Null
Push-Location $main_repo_dir
$main_repo_url = '${{ github.server_url }}/${{ github.repository }}'
# $main_repo_branch = '${{ github.head_ref || github.ref_name }}'
$main_repo_branch = '${{ github.event.repository.default_branch }}'
Write-Host "Cloning main repo [$main_repo_url]: branch [$main_repo_branch]"
git clone -b $main_repo_branch --filter=tree:0 --no-progress --no-checkout $main_repo_url .
Expand Down

0 comments on commit 04a53af

Please sign in to comment.