Add FilePattern support for .github\workflow sync (#5919)

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.

Co-authored-by: Wes Haggard <Wes.Haggard@microsoft.com>
This commit is contained in:
Azure SDK Bot 2024-08-16 14:03:15 -07:00 committed by GitHub
parent 211b1fdb95
commit 758460d618
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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}"