File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 33
33
- name : Process test results
34
34
if : ${{ success() || failure() }}
35
35
shell : pwsh
36
- run : ./eng/process-test-results.ps1
36
+ run : ./eng/process-test-results.ps1 -Branch "${{ github.head_ref || github.ref_name }}"
37
37
env :
38
38
GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change 1
1
[CmdletBinding (PositionalBinding = $false )]
2
2
param (
3
+ $branch = $null ,
3
4
[switch ]$dry = $false
4
5
)
5
6
@@ -8,7 +9,8 @@ $ErrorActionPreference = "Stop"
8
9
9
10
# If snapshots are changed, create a pull request.
10
11
if (git status -- porcelain) {
11
- $currentBranch = $ (git branch -- show-current )
12
+ $currentBranch = $branch ?? $ (git branch -- show-current )
13
+ Write-Output " Branch: '$currentBranch '"
12
14
13
15
# Avoid making new PR against snapshot-updating PR.
14
16
if ($currentBranch.StartsWith (" update-snapshots" )) {
@@ -23,14 +25,10 @@ if (git status --porcelain) {
23
25
24
26
git branch - D update-snapshots / $currentBranch
25
27
git checkout - b update-snapshots / $currentBranch
26
- try {
27
- git commit - am " Update snapshots"
28
- git push -f origin update-snapshots / $currentBranch
29
- gh pr create -- base $currentBranch -- title " Update snapshots" `
30
- -- body " Generate automatically by script `` process-test-results.ps1`` ."
31
- } finally {
32
- git checkout $currentBranch
33
- }
28
+ git commit - am " Update snapshots"
29
+ git push -f origin update-snapshots / $currentBranch
30
+ gh pr create -- base $currentBranch -- title " Update snapshots" `
31
+ -- body " Generated automatically by script `` process-test-results.ps1`` ."
34
32
} else {
35
33
Write-Output " No changes in snapshots"
36
34
}
You can’t perform that action at this time.
0 commit comments