[CI] Checkout the head ref rather than the merge or a reset, this should fix issues with the test selector. (#14496)
This commit is contained in:
Родитель
ab513555a6
Коммит
d36d87f11e
|
@ -164,8 +164,8 @@ namespace Xharness {
|
|||
|
||||
IEnumerable<string> GetModifiedFilesLocally (int pullRequest)
|
||||
{
|
||||
var base_commit = $"origin/pr/{pullRequest}/merge^";
|
||||
var head_commit = $"origin/pr/{pullRequest}/merge";
|
||||
var base_commit = $"origin/pull/{pullRequest}/merge^";
|
||||
var head_commit = $"origin/pull/{pullRequest}/merge";
|
||||
|
||||
harness.Log ("Fetching modified files for commit range {0}..{1}", base_commit, head_commit);
|
||||
|
||||
|
|
|
@ -52,7 +52,13 @@ steps:
|
|||
|
||||
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
|
||||
- pwsh: |
|
||||
git reset --hard HEAD^2
|
||||
git config remote.origin.fetch '+refs/pull/*:refs/remotes/origin/pull/*'
|
||||
git fetch origin
|
||||
$branch="$(Build.SourceBranch)".Replace("merge", "head")
|
||||
$branch=$branch.Replace("refs", "origin")
|
||||
Write-Host "Checking out branch $branch"
|
||||
git checkout $branch
|
||||
git branch -a
|
||||
displayName: "Undo Github merge"
|
||||
workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-macios
|
||||
|
||||
|
|
|
@ -54,7 +54,13 @@ steps:
|
|||
|
||||
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
|
||||
- pwsh: |
|
||||
git reset --hard HEAD^2
|
||||
git config remote.origin.fetch '+refs/pull/*:refs/remotes/origin/pull/*'
|
||||
git fetch origin
|
||||
$branch="$(Build.SourceBranch)".Replace("merge", "head")
|
||||
$branch=$branch.Replace("refs", "origin")
|
||||
Write-Host "Checking out branch $branch"
|
||||
git checkout $branch
|
||||
git branch -a
|
||||
displayName: "Undo Github merge"
|
||||
workingDirectory: $(System.DefaultWorkingDirectory)/xamarin-macios
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче