Skip to content

Commit 2612422

Browse files
azure-sdkchidozieononiwuweshaggard
authored
Sync eng/common directory with azure-sdk-tools for PR 1358 (Azure#18686)
* Extend Get-GitHubPullRequest to return only files * Add check to prevent eng/common changes that are not proper syncs * Update eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com> * Update eng/common/pipelines/templates/steps/eng-common-workflow-enforcer.yml Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com> Co-authored-by: Chidozie Ononiwu <chononiw@microsoft.com> Co-authored-by: Chidozie Ononiwu <31145988+chidozieononiwu@users.noreply.github.com> Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
1 parent 65624c2 commit 2612422

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
steps:
2+
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
3+
- pwsh: |
4+
$filesInCommonDir = git diff "origin/$(System.PullRequest.TargetBranch)" HEAD --name-only -- 'eng/common/*'
5+
6+
if ((-not $PrSourceBranch.StartsWith("sync-eng/common")) -and ($filesInCommonDir.Count -gt 0))
7+
{
8+
Write-Host "##vso[task.LogIssue type=error;]Changes to files under 'eng/common' directory should not be made in this Repo`n${filesInCommonDir}"
9+
Write-Host "##vso[task.LogIssue type=error;]Please follow workflow at https://github.com/Azure/azure-sdk-tools/blob/master/doc/common/common_engsys.md"
10+
exit 1
11+
}
12+
displayName: Prevent changes to eng/common outside of azure-sdk-tools repo
13+
condition: and(succeeded(), ne(variables['Skip.EngCommonWorkflowEnforcer'], 'true'))

0 commit comments

Comments
 (0)