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 c6b54acb3a6a..f4b385e14550 100644 --- a/eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml +++ b/eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml @@ -19,20 +19,20 @@ steps: exit 1 } } - if ((!"$(System.PullRequest.SourceBranch)".StartsWith("sync-.github/workflows")) -and "$(System.PullRequest.TargetBranch)" -match "^(refs/heads/)?$(DefaultBranch)$") + if ((!"$(System.PullRequest.SourceBranch)".StartsWith("sync-.github")) -and "$(System.PullRequest.TargetBranch)" -match "^(refs/heads/)?$(DefaultBranch)$") { - # 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") + # This list needs to be kept in sync with the FilePatterns listed in eng/pipelines/eng-github-config-sync.yml + $filePatterns = @(".github/workflows/*event*", ".github/workflows/post-apiview.yml", ".github/skills/azsdk-common-*/**") $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;]Changes to selected files under '.github/' 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" exit 1 } } - displayName: Prevent changes to eng/common and .github/workflows outside of azure-sdk-tools repo + displayName: Prevent changes to eng/common and selected .github/* files outside of azure-sdk-tools repo condition: and(succeeded(), ne(variables['Skip.EngCommonWorkflowEnforcer'], 'true'), not(endsWith(variables['Build.Repository.Name'], '-pr'))) diff --git a/eng/common/scripts/Delete-RemoteBranches.ps1 b/eng/common/scripts/Delete-RemoteBranches.ps1 index 9ff5006e1ab0..102806d7086d 100644 --- a/eng/common/scripts/Delete-RemoteBranches.ps1 +++ b/eng/common/scripts/Delete-RemoteBranches.ps1 @@ -6,7 +6,7 @@ param( $CentralRepoId, # We start from the sync PRs, use the branch name to get the PR number of central repo. E.g. sync-eng/common-()-(). Have group name on PR number. # For sync-eng/common work, we use regex as "^sync-eng/common.*-(?\d+).*$". - # For sync-.github/workflows work, we use regex as "^sync-.github/workflows.*-(?\d+).*$". + # For sync-.github work, we use regex as "^sync-.github.*-(?\d+).*$". $BranchRegex, # When set, directly delete this exact branch name without querying all branches. # This is a fast path that avoids the expensive GraphQL branch listing and rate limit