Skip to content

Commit 1051c2d

Browse files
Sync eng/common directory with azure-sdk-tools for PR 10432 (#40691)
* Update workflow sync pipeline * Remove exit code check as the list of files should be good enough --------- Co-authored-by: Wes Haggard <[email protected]>
1 parent 0e91c75 commit 1051c2d

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml

+9-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ steps:
1111
1212
if ((!"$(System.PullRequest.SourceBranch)".StartsWith("sync-eng/common")) -and "$(System.PullRequest.TargetBranch)" -match "^(refs/heads/)?$(DefaultBranch)$")
1313
{
14-
$filesInCommonDir = & "eng/common/scripts/get-changedfiles.ps1" -DiffPath 'eng/common/*' -DiffFilterType ""
15-
if (($LASTEXITCODE -eq 0) -and ($filesInCommonDir.Count -gt 0))
14+
$filesInCommonDir = & "eng/common/scripts/get-changedfiles.ps1" -DiffPath 'eng/common/*' -DiffFilterType ""
15+
if ($filesInCommonDir.Count -gt 0)
1616
{
1717
Write-Host "##vso[task.LogIssue type=error;]Changes to files under 'eng/common' directory should not be made in this Repo`n${filesInCommonDir}"
1818
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:
2121
}
2222
if ((!"$(System.PullRequest.SourceBranch)".StartsWith("sync-.github/workflows")) -and "$(System.PullRequest.TargetBranch)" -match "^(refs/heads/)?$(DefaultBranch)$")
2323
{
24-
$filesInCommonDir = & "eng/common/scripts/get-changedfiles.ps1" -DiffPath '.github/workflows/*event*' -DiffFilterType ""
25-
if (($LASTEXITCODE -eq 0) -and ($filesInCommonDir.Count -gt 0))
24+
# This list needs to be kept in sync with the FilePatterns listed in eng/pipelines/eng-workflows-sync.yml
25+
$filePatterns = @(".github/workflows/*event*", ".github/workflows/post-apiview.yml")
26+
$filesInCommonDir = @()
27+
foreach ($filePattern in $filePatterns) {
28+
$filesInCommonDir += & "eng/common/scripts/get-changedfiles.ps1" -DiffPath $filePattern -DiffFilterType ""
29+
}
30+
if ($filesInCommonDir.Count -gt 0)
2631
{
2732
Write-Host "##vso[task.LogIssue type=error;]Changes to files under '.github/workflows' directory should not be made in this Repo`n${filesInCommonDir}"
2833
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"

0 commit comments

Comments
 (0)