Skip to content

Commit

Permalink
Remove Verify an Merge Stage, Add auto-merge label to the Tools PR
Browse files Browse the repository at this point in the history
  • Loading branch information
chidozieononiwu committed Oct 8, 2020
1 parent 6f7eb91 commit b3fe149
Showing 1 changed file with 6 additions and 61 deletions.
67 changes: 6 additions & 61 deletions eng/pipelines/eng-common-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ stages:
steps:
- checkout: self

- pwsh: |
New-Item -Path $(Build.ArtifactStagingDirectory)/${{ parameters.PRDataFileName }} -ItemType File
displayName: Create PRData Artifact
- ${{ each repo in parameters.Repos }}:
- task: PowerShell@2
displayName: Create pull request
Expand All @@ -118,7 +114,7 @@ stages:
-PRBranch "sync-${{ parameters.DirectoryToSync }}-$(System.PullRequest.SourceBranch)-$(System.PullRequest.PullRequestNumber)"
-AuthToken "$(azuresdk-github-pat)"
-PRTitle "Sync ${{ parameters.DirectoryToSync }} directory with azure-sdk-tools for PR $(System.PullRequest.PullRequestNumber)"
-PRLabels "Central-EngSys, EngSys"
-PRLabels "Central-EngSys,EngSys,auto-merge"
-PRBody "Sync ${{ parameters.DirectoryToSync }} directory with azure-sdk-tools for PR https://github.com/Azure/azure-sdk-tools/pull/$(System.PullRequest.PullRequestNumber)`
See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/master/eng/common/README.md#workflow)"
${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
Expand All @@ -134,59 +130,8 @@ stages:
-PRBody "Sync ${{ parameters.DirectoryToSync }} directory with azure-sdk-tools for PR https://github.com/Azure/azure-sdk-tools/pull/$(System.PullRequest.PullRequestNumber)`
See [eng/common workflow](https://github.com/Azure/azure-sdk-tools/blob/master/eng/common/README.md#workflow)"
- pwsh: |
$PRData = "Azure;${{ repo }};$(Submitted.PullRequest.Number)"
Add-Content -Path "$(Build.ArtifactStagingDirectory)/${{ parameters.PRDataFileName }}" -Value $PRData
displayName: Write Sync PR Data to Artifact File
condition: succeeded()
- task: PublishPipelineArtifact@1
condition: succeeded()
displayName: Publish ${{ parameters.PRDataFileName }}
inputs:
artifactName: ${{ parameters.ArtifactName }}
path: $(Build.ArtifactStagingDirectory)/${{ parameters.PRDataFileName }}

- stage: VerifyAndMerge
jobs:
- deployment: VerifyandMergeSyncPrs
displayName: Verify and Merge Sync PRs
environment: githubmerges

pool:
vmImage: windows-2019

strategy:
runOnce:
deploy:
steps:
- checkout: self

- download: current
artifact: ${{parameters.ArtifactName}}
displayName: Download ${{ parameters.PRDataFileName }}

- task: PowerShell@2
displayName: 'Verify then Merge Pull Requests'
inputs:
targetType: filePath
filePath: $(Build.SourcesDirectory)/eng/scripts/Verify-And-Merge-PRs.ps1
arguments: >
-PRDataArtifactPath "$(Pipeline.Workspace)/${{parameters.ArtifactName}}/${{ parameters.PRDataFileName }}"
-AuthToken "$(azuresdk-github-pat)"
-devOpsLogging
pwsh: true

- ${{ if ne(variables['Build.Reason'], 'PullRequest') }}:
- ${{ each repo in parameters.Repos }}:
- pwsh: |
git clone https://github.com/azure/${{ repo }} --depth 1
pushd $(System.DefaultWorkingDirectory)/${{ repo }}
git push origin --delete "sync-${{ parameters.DirectoryToSync }}-$(System.PullRequest.SourceBranch)-$(System.PullRequest.PullRequestNumber)"
if ($lastExitCode -ne 0) {
Write-Host "Failed to delete [sync-${{ parameters.DirectoryToSync }}-$(System.PullRequest.SourceBranch)-$(System.PullRequest.PullRequestNumber)] branch in ${{ repo }}"
exit 1
}
displayName: Write Sync PR Data to Artifact File
workingDirectory: $(System.DefaultWorkingDirectory)
condition: succeeded()
- pwsh: |
. "$(Build.SourcesDirectory)\eng\common\scripts\Invoke-GitHub-API.ps1" -AuthToken "$(azuresdk-github-pat)"
UpdateIssue -RepoOwner "Azure" -RepoName "azure-sdk-tools" -IssueNumber $(System.PullRequest.PullRequestNumber) -labels "auto-merge"
displayName: Add Auto Merge to Tool PR.
condition: succeeded()

0 comments on commit b3fe149

Please sign in to comment.