Remove skip API validation for forks (#514)

* Add a skip validation for forks

* Fix var packageFeed

* Remove skip validation

* Cleanup
This commit is contained in:
BruceHaley 2022-08-03 14:04:31 -07:00 коммит произвёл GitHub
Родитель ea23975413
Коммит b9872d1449
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 12 добавлений и 23 удалений

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

@ -1,5 +1,4 @@
# Create nuget.config for getting packages from PowerFx feed or SDK_Dotnet_V4_org feed or NuGet.org feed.
# Resolve from nuget.org when PR is from a fork, as forks do not have access to our private feed.
parameters:
- name: feedName
displayName: Azure or NuGet
@ -7,26 +6,18 @@ parameters:
steps:
- powershell: |
if ("$(System.PullRequest.IsFork)" -eq 'True') {
$key = "nuget.org";
$value = "https://api.nuget.org/v3/index.json";
$key2 = "nuget.org2";
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";
$key2 = "nuget.org";
$value2 = "https://api.nuget.org/v3/index.json";
Write-Host 'NuGet feed: System.PullRequest.IsFork = True';
Write-Host 'SDK_Dotnet_V4_org feed';
} else {
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";
$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';
}
$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';
}
$file = "$(Build.SourcesDirectory)\nuget.config";

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

@ -12,7 +12,7 @@ steps:
$packageName = ($env:PackagesToValidate.Split(","))[0];
[string]$contractVersion = "";
if ("${{ parameters.feedName }}" -eq 'Azure' -and "$(System.PullRequest.IsFork)" -ne 'True') {
if ("${{ parameters.feedName }}" -eq 'Azure') {
Write-Host "Get latest $packageName version number from Azure feed";

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

@ -132,8 +132,6 @@ stages:
- stage: API_Compatibility_Validation
dependsOn: Build
# Skip API validation against Azure for a fork, as forks do not have access to our private feed.
condition: and(succeeded(), or(ne(variables['System.PullRequest.IsFork'], 'True'), eq('${{ parameters.packageFeed }}', 'NuGet')))
variables:
skipComponentGovernanceDetection: true # the task is already injected into the build job, so skip it here.
jobs:
@ -198,7 +196,7 @@ stages:
- job: post_results_to_gitHub
dependsOn: check_api_for
condition: ne(dependencies.generate_multiconfig_var.outputs['generate_var.MULTICONFIG'], '{}')
condition: and(succeeded(), ne(dependencies.generate_multiconfig_var.outputs['generate_var.MULTICONFIG'], '{}'), ne(variables['System.PullRequest.IsFork'], 'True'))
steps:
- checkout: none