From 92246a2d909b8804d88d387d899b9a083b4d9d33 Mon Sep 17 00:00:00 2001 From: Azure SDK Bot <53356347+azure-sdk@users.noreply.github.com> Date: Wed, 23 Apr 2025 15:43:35 -0700 Subject: [PATCH] Sync eng/common directory with azure-sdk-tools for PR 10432 (#6539) --- .../steps/eng-common-workflow-enforcer.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml b/eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml index 1524ae8e1..c6b54acb3 100644 --- a/eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml +++ b/eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml @@ -11,8 +11,8 @@ steps: if ((!"$(System.PullRequest.SourceBranch)".StartsWith("sync-eng/common")) -and "$(System.PullRequest.TargetBranch)" -match "^(refs/heads/)?$(DefaultBranch)$") { - $filesInCommonDir = & "eng/common/scripts/get-changedfiles.ps1" -DiffPath 'eng/common/*' -DiffFilterType "" - if (($LASTEXITCODE -eq 0) -and ($filesInCommonDir.Count -gt 0)) + $filesInCommonDir = & "eng/common/scripts/get-changedfiles.ps1" -DiffPath 'eng/common/*' -DiffFilterType "" + if ($filesInCommonDir.Count -gt 0) { Write-Host "##vso[task.LogIssue type=error;]Changes to files under 'eng/common' directory should not be made in this Repo`n${filesInCommonDir}" Write-Host "##vso[task.LogIssue type=error;]Please follow workflow at https://github.com/Azure/azure-sdk-tools/blob/main/doc/common/common_engsys.md" @@ -21,8 +21,13 @@ steps: } if ((!"$(System.PullRequest.SourceBranch)".StartsWith("sync-.github/workflows")) -and "$(System.PullRequest.TargetBranch)" -match "^(refs/heads/)?$(DefaultBranch)$") { - $filesInCommonDir = & "eng/common/scripts/get-changedfiles.ps1" -DiffPath '.github/workflows/*event*' -DiffFilterType "" - if (($LASTEXITCODE -eq 0) -and ($filesInCommonDir.Count -gt 0)) + # This list needs to be kept in sync with the FilePatterns listed in eng/pipelines/eng-workflows-sync.yml + $filePatterns = @(".github/workflows/*event*", ".github/workflows/post-apiview.yml") + $filesInCommonDir = @() + foreach ($filePattern in $filePatterns) { + $filesInCommonDir += & "eng/common/scripts/get-changedfiles.ps1" -DiffPath $filePattern -DiffFilterType "" + } + if ($filesInCommonDir.Count -gt 0) { Write-Host "##vso[task.LogIssue type=error;]Changes to files under '.github/workflows' directory should not be made in this Repo`n${filesInCommonDir}" Write-Host "##vso[task.LogIssue type=error;]Please follow workflow at https://github.com/Azure/azure-sdk-tools/blob/main/doc/workflows/engsys_workflows.md"