@@ -37,12 +37,12 @@ dotnet nuget add source https://pkgs.dev.azure.com/nanoframework/feed/_packaging
37
37
# ###################
38
38
# VS 2019 & 2022
39
39
40
- Write-Host " Updating nanoFramework.Tools.Debugger.Net package in VS2019 & VS2022 solution..."
40
+ Write-Host " Updating nanoFramework.TestFramework package in VS2019 & VS2022 solution..."
41
41
42
- dotnet remove VisualStudio.Extension- 2019 / VisualStudio.Extension- vs2019.csproj package nanoFramework.Tools.Debugger.Net
43
- dotnet add VisualStudio.Extension- 2019 / VisualStudio.Extension- vs2019.csproj package nanoFramework.Tools.Debugger.Net -- prerelease
44
- dotnet remove VisualStudio.Extension- 2022 / VisualStudio.Extension- vs2022.csproj package nanoFramework.Tools.Debugger.Net
45
- dotnet add VisualStudio.Extension- 2022 / VisualStudio.Extension- vs2022.csproj package nanoFramework.Tools.Debugger.Net -- prerelease
42
+ dotnet remove VisualStudio.Extension- 2019 / VisualStudio.Extension- vs2019.csproj package nanoFramework.TestFramework
43
+ dotnet add VisualStudio.Extension- 2019 / VisualStudio.Extension- vs2019.csproj package nanoFramework.TestFramework -- prerelease
44
+ dotnet remove VisualStudio.Extension- 2022 / VisualStudio.Extension- vs2022.csproj package nanoFramework.TestFramework
45
+ dotnet add VisualStudio.Extension- 2022 / VisualStudio.Extension- vs2022.csproj package nanoFramework.TestFramework -- prerelease
46
46
47
47
# ####################
48
48
@@ -61,52 +61,62 @@ $commitMessage += "### :warning: This is an automated update. Merge only after a
61
61
62
62
Write-Debug " Git branch"
63
63
64
- # create branch to perform updates
65
- git branch $newBranchName
64
+ # check if anything was changed
65
+ $repoStatus = " $ ( git status -- short -- porcelain ) "
66
66
67
- Write-Debug " Checkout branch"
67
+ if ($repoStatus -ne " " )
68
+ {
69
+ # create branch to perform updates
70
+ git branch $newBranchName
68
71
69
- # checkout branch
70
- git checkout $newBranchName
72
+ Write-Debug " Checkout branch"
71
73
72
- Write-Debug " Add changes"
74
+ # checkout branch
75
+ git checkout $newBranchName
73
76
74
- # commit changes
75
- git add - A > $null
77
+ Write-Debug " Add changes"
76
78
77
- Write-Debug " Commit changed files"
79
+ # commit changes
80
+ git add - A > $null
78
81
79
- git commit - m " $prTitle ***NO_CI*** " - m " $commitMessage " > $null
82
+ Write-Debug " Commit changed files "
80
83
81
- Write-Debug " Push changes "
84
+ git commit - m " $prTitle ***NO_CI*** " - m " $commitMessage " > $null
82
85
83
- git - c http.extraheader = " AUTHORIZATION: $auth " push -- set-upstream origin $newBranchName > $null
86
+ Write-Debug " Push changes "
84
87
85
- # start PR
86
- # we are hardcoding to 'develop' branch to have a fixed one
87
- # this is very important for tags (which don't have branch information)
88
- # considering that the base branch can be changed at the PR ther is no big deal about this
89
- $prRequestBody = @ {title = " $prTitle " ;body = " $commitMessage " ;head = " $newBranchName " ;base = " develop" } | ConvertTo-Json
90
- $githubApiEndpoint = " https://api.github.com/repos/nanoframework/nf-Visual-Studio-extension/pulls"
91
- [Net.ServicePointManager ]::SecurityProtocol = [Net.SecurityProtocolType ]::Tls12
88
+ git - c http.extraheader= " AUTHORIZATION: $auth " push -- set-upstream origin $newBranchName > $null
92
89
93
- $headers = @ {}
94
- $headers.Add (" Authorization" , " $auth " )
95
- $headers.Add (" Accept" , " application/vnd.github.symmetra-preview+json" )
90
+ # start PR
91
+ # we are hardcoding to 'develop' branch to have a fixed one
92
+ # this is very important for tags (which don't have branch information)
93
+ # considering that the base branch can be changed at the PR ther is no big deal about this
94
+ $prRequestBody = @ {title = " $prTitle " ;body = " $commitMessage " ;head = " $newBranchName " ;base = " develop" } | ConvertTo-Json
95
+ $githubApiEndpoint = " https://api.github.com/repos/nanoframework/nf-Visual-Studio-extension/pulls"
96
+ [Net.ServicePointManager ]::SecurityProtocol = [Net.SecurityProtocolType ]::Tls12
96
97
97
- try
98
- {
99
- $result = Invoke-RestMethod - Method Post - UserAgent [Microsoft.PowerShell.Commands.PSUserAgent ]::InternetExplorer - Uri $githubApiEndpoint - Header $headers - ContentType " application/json" - Body $prRequestBody
100
- ' Started PR with dependencies update...' | Write-Host - NoNewline
101
- ' OK' | Write-Host - ForegroundColor Green
98
+ $headers = @ {}
99
+ $headers.Add (" Authorization" , " $auth " )
100
+ $headers.Add (" Accept" , " application/vnd.github.symmetra-preview+json" )
101
+
102
+ try
103
+ {
104
+ $result = Invoke-RestMethod - Method Post - UserAgent [Microsoft.PowerShell.Commands.PSUserAgent ]::InternetExplorer - Uri $githubApiEndpoint - Header $headers - ContentType " application/json" - Body $prRequestBody
105
+ ' Started PR with dependencies update...' | Write-Host - NoNewline
106
+ ' OK' | Write-Host - ForegroundColor Green
107
+ }
108
+ catch
109
+ {
110
+ $result = $_.Exception.Response.GetResponseStream ()
111
+ $reader = New-Object System.IO.StreamReader($result )
112
+ $reader.BaseStream.Position = 0
113
+ $reader.DiscardBufferedData ()
114
+ $responseBody = $reader.ReadToEnd ();
115
+
116
+ throw " Error starting PR: $responseBody "
117
+ }
102
118
}
103
- catch
119
+ else
104
120
{
105
- $result = $_.Exception.Response.GetResponseStream ()
106
- $reader = New-Object System.IO.StreamReader($result )
107
- $reader.BaseStream.Position = 0
108
- $reader.DiscardBufferedData ()
109
- $responseBody = $reader.ReadToEnd ();
110
-
111
- throw " Error starting PR: $responseBody "
121
+ Write-Host " Nothing to udpate in Visual-Studio-extension"
112
122
}
0 commit comments