Skip to content

Commit c12bdcf

Browse files
committed
Work CI-CD
- VS extension PRs now adds the version flags too. - Remove wrong edition of extension cs project files. Everything is already up to date. - Rename env var with github token. ***NO_CI***
1 parent 296050d commit c12bdcf

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ jobs:
200200
targetType: filePath
201201
filePath: azure-pipelines/update-vs-extension.ps1
202202
env:
203-
MY_GITHUB_TOKEN: $(GitHubToken)
203+
GITHUB_TOKEN: $(GitHubToken)
204204

205205
##################################
206206
# report build failure to Discord

azure-pipelines/update-vs-extension.ps1

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function AddGeneratePathProperty {
3434

3535
# compute authorization header in format "AUTHORIZATION: basic 'encoded token'"
3636
# 'encoded token' is the Base64 of the string "nfbot:personal-token"
37-
$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$env:MY_GITHUB_TOKEN")))"
37+
$auth = "basic $([System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("nfbot:$env:GITHUB_TOKEN")))"
3838

3939
# uncomment these for local debug
4040
# [Environment]::SetEnvironmentVariable('NBGV_NuGetPackageVersion', '2.0.42', 'Process')
@@ -141,10 +141,6 @@ if ($repoStatus -ne "")
141141
UpdateTCoreLibraryVersion -NewVersion $packageTargetVersion -FilePath 'CSharp.TestApplication/CS.TestApplication-vs2022.vstemplate'
142142
UpdateTCoreLibraryVersion -NewVersion $packageTargetVersion -FilePath 'CSharp.TestApplication/NFUnitTest.nfproj'
143143

144-
# update remaining project refs
145-
UpdateTCoreLibraryVersion -NewVersion $packageTargetVersion -FilePath 'VisualStudio.Extension-2019/VisualStudio.Extension-vs2019.csproj'
146-
UpdateTCoreLibraryVersion -NewVersion $packageTargetVersion -FilePath 'VisualStudio.Extension-2022/VisualStudio.Extension-vs2022.csproj'
147-
148144
# create branch to perform updates
149145
git branch $newBranchName
150146

@@ -182,6 +178,12 @@ if ($repoStatus -ne "")
182178
$result = Invoke-RestMethod -Method Post -UserAgent [Microsoft.PowerShell.Commands.PSUserAgent]::InternetExplorer -Uri $githubApiEndpoint -Header $headers -ContentType "application/json" -Body $prRequestBody
183179
'Started PR with dependencies update...' | Write-Host -NoNewline
184180
'OK' | Write-Host -ForegroundColor Green
181+
182+
# add labels to PR
183+
$prNumber = $result.number
184+
185+
gh pr edit $prNumber --add-label "VS2019"
186+
gh pr edit $prNumber --add-label "VS2022"
185187
}
186188
catch
187189
{

0 commit comments

Comments
 (0)