Skip to content

Commit d5e7732

Browse files
Sync eng/common directory with azure-sdk-tools for PR 15625 (#49181)
* Split github workflow and github skills sync into two pipelines * Update eng/common workflow enforcer branch skip detection --------- Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
1 parent 6d2608a commit d5e7732

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ steps:
99
# Find the default branch of the repo. The variable value sets in build step.
1010
Write-Host "Default Branch: $(DefaultBranch)"
1111
12-
if ((!"$(System.PullRequest.SourceBranch)".StartsWith("sync-eng/common")) -and "$(System.PullRequest.TargetBranch)" -match "^(refs/heads/)?$(DefaultBranch)$")
12+
if ((!"$(System.PullRequest.SourceBranch)".StartsWith("sync-eng-common")) -and "$(System.PullRequest.TargetBranch)" -match "^(refs/heads/)?$(DefaultBranch)$")
1313
{
1414
$filesInCommonDir = & "eng/common/scripts/get-changedfiles.ps1" -DiffPath 'eng/common/*' -DiffFilterType ""
1515
if ($filesInCommonDir.Count -gt 0)
@@ -21,15 +21,18 @@ steps:
2121
}
2222
if ((!"$(System.PullRequest.SourceBranch)".StartsWith("sync-.github")) -and "$(System.PullRequest.TargetBranch)" -match "^(refs/heads/)?$(DefaultBranch)$")
2323
{
24-
# This list needs to be kept in sync with the FilePatterns listed in eng/pipelines/sync-.github.yml
25-
$filePatterns = @(".github/workflows/*event*", ".github/workflows/post-apiview.yml", ".github/skills/azsdk-common-*/**")
24+
# These lists need to be kept in sync with eng/pipelines/sync-.github.yml and
25+
# eng/pipelines/sync-.github-skills.yml.
26+
$workflowFilePatterns = @(".github/workflows/*event*", ".github/workflows/post-apiview.yml", ".github/workflows/protected-files.yml")
27+
$skillsFilePatterns = @(".github/skills/azsdk-common-*/**")
28+
$filePatterns = @($workflowFilePatterns + $skillsFilePatterns)
2629
$filesInCommonDir = @()
2730
foreach ($filePattern in $filePatterns) {
2831
$filesInCommonDir += & "eng/common/scripts/get-changedfiles.ps1" -DiffPath $filePattern -DiffFilterType ""
2932
}
3033
if ($filesInCommonDir.Count -gt 0)
3134
{
32-
Write-Host "##vso[task.LogIssue type=error;]Changes to selected files under '.github/' directory should not be made in this Repo`n${filesInCommonDir}"
35+
Write-Host "##vso[task.LogIssue type=error;]Changes to selected workflow and shared skill files under '.github/' should not be made in this Repo`n${filesInCommonDir}"
3336
Write-Host "##vso[task.LogIssue type=error;]Follow the workflow at https://github.com/Azure/azure-sdk-tools/blob/main/doc/engsys_workflows_and_skills.md"
3437
exit 1
3538
}

eng/common/scripts/Delete-RemoteBranches.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ param(
66
$CentralRepoId,
77
# We start from the sync PRs, use the branch name to get the PR number of central repo. E.g. sync-eng/common-(<branchName>)-(<PrNumber>). Have group name on PR number.
88
# For sync-eng/common work, we use regex as "^sync-eng/common.*-(?<PrNumber>\d+).*$".
9-
# For sync-.github work, we use regex as "^sync-.github.*-(?<PrNumber>\d+).*$".
9+
# For sync-.github and sync-.github-skills work, we use regex as
10+
# "^sync-\.github.*-(?<PrNumber>\d+).*$".
1011
$BranchRegex,
1112
# When set, directly delete this exact branch name without querying all branches.
1213
# This is a fast path that avoids the expensive GraphQL branch listing and rate limit

0 commit comments

Comments
 (0)