Fix bugs in API validation for forks (#517)

* Remove condition from generate_multiconfig_var

* Fix feed setup, fix tag build
This commit is contained in:
BruceHaley 2022-08-03 22:07:22 -07:00 коммит произвёл GitHub
Родитель b9872d1449
Коммит 25e9106435
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
2 изменённых файлов: 20 добавлений и 7 удалений

Просмотреть файл

@ -7,17 +7,30 @@ parameters:
steps:
- powershell: |
if ("${{ parameters.feedName }}" -eq 'NuGet') {
$key = "SDK_Dotnet_V4_org";
$value = "https://pkgs.dev.azure.com/FuseLabs/_packaging/SDK_Dotnet_V4_org/nuget/v3/index.json";
if ("$(System.PullRequest.IsFork)" -eq 'True') {
$key = "nuget.org";
$value = "https://api.nuget.org/v3/index.json";
Write-Host 'nuget.org feed: System.PullRequest.IsFork = True';
} else {
# This private feed cannot be accessed by a fork.
$key = "SDK_Dotnet_V4_org";
$value = "https://pkgs.dev.azure.com/FuseLabs/_packaging/SDK_Dotnet_V4_org/nuget/v3/index.json";
Write-Host 'SDK_Dotnet_V4_org feed';
}
$key2 = "nuget.org";
$value2 = "https://api.nuget.org/v3/index.json";
Write-Host 'SDK_Dotnet_V4_org feed';
} else {
$key = "PowerFx";
$value = "$(PowerFx_daily_feed_Url)";
$key2 = "SDK_Dotnet_V4_org";
$value2 = "https://pkgs.dev.azure.com/FuseLabs/_packaging/SDK_Dotnet_V4_org/nuget/v3/index.json";
Write-Host 'PowerFx feed';
Write-Host 'PowerFx daily feed';
if ("$(System.PullRequest.IsFork)" -eq 'True') {
$key2 = "nuget.org";
$value2 = "https://api.nuget.org/v3/index.json";
} else {
$key2 = "SDK_Dotnet_V4_org";
$value2 = "https://pkgs.dev.azure.com/FuseLabs/_packaging/SDK_Dotnet_V4_org/nuget/v3/index.json";
}
}
$file = "$(Build.SourcesDirectory)\nuget.config";

Просмотреть файл

@ -136,7 +136,6 @@ stages:
skipComponentGovernanceDetection: true # the task is already injected into the build job, so skip it here.
jobs:
- job: generate_multiconfig_var
condition: and(succeeded(), ne(variables['System.PullRequest.IsFork'], 'True'))
steps:
- checkout: none
@ -155,6 +154,7 @@ stages:
tags: |
Comparing API against v $(GetContract.ContractVersion)
From ${{ parameters.packageFeed }} feed
condition: and(succeeded(), ne(variables['System.PullRequest.IsFork'], 'True'))
continueOnError: true
- powershell: |