Sync eng/common directory with azure-sdk-tools for PR 1358 (#1669)

* 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>
This commit is contained in:
Azure SDK Bot 2021-02-11 10:12:13 -08:00 committed by GitHub
parent a02d8a2693
commit 3282a05d49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,13 @@
steps:
- ${{ if eq(variables['Build.Reason'], 'PullRequest') }}:
- pwsh: |
$filesInCommonDir = git diff "origin/$(System.PullRequest.TargetBranch)" HEAD --name-only -- 'eng/common/*'
if ((-not $PrSourceBranch.StartsWith("sync-eng/common")) -and ($filesInCommonDir.Count -gt 0))
{
Write-Host "##vso[task.LogIssue type=error;]Changes to files under 'eng/common' 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/master/doc/common/common_engsys.md"
exit 1
}
displayName: Prevent changes to eng/common outside of azure-sdk-tools repo
condition: and(succeeded(), ne(variables['Skip.EngCommonWorkflowEnforcer'], 'true'))