From a80426f77a2d1cebfc00534fce47f48f11a0c800 Mon Sep 17 00:00:00 2001 From: Wes Haggard Date: Fri, 16 Aug 2024 10:56:00 -0700 Subject: [PATCH] Add FilePattern support for .github\workflow sync Given we cannot create subfolders under .github\workflow folder and we have repos that want additional workflows then we have in the tools repo we need to setup a file pattern matching for the sync processing to only sync the ones we want to be common. For now just use the existing *event* pattern but we can move them to another pattern similar to *common* or *sync* in the future as we add more common workflows. --- .../pipelines/templates/steps/eng-common-workflow-enforcer.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 b455fec2100..1524ae8e1b8 100644 --- a/eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml +++ b/eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml @@ -21,7 +21,7 @@ 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/*' -DiffFilterType "" + $filesInCommonDir = & "eng/common/scripts/get-changedfiles.ps1" -DiffPath '.github/workflows/*event*' -DiffFilterType "" if (($LASTEXITCODE -eq 0) -and ($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}"