Welcome to mirror list, hosted at ThFree Co, Russian Federation.

merge-translations-update.yml « stages « automation « .build - github.com/xamarin/Xamarin.PropertyEditing.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e70f091b1350ec05fc529461a31d68eb106068a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
stages:
  - stage: merge_translations_updates
    displayName: 'Merge Translations Updates'
    dependsOn: [validate]
    condition: and( succeeded(), and( eq(variables.isTargetMainBranch, true), variables.isLocPRBranch ) ) 

    jobs:
      - job : validate_merge
        displayName: 'Validate and Merge Translations'
        pool:
          name: VSEng-ReleasePool
        variables:
          pull_request_number: $(System.PullRequest.PullRequestNumber)
        workspace:
          clean: all

        steps:
          - powershell: |
              Write-Host "Validating translations for PR# $(System.PullRequest.PullRequestNumber)"
              $srcDir = "$(Build.SourcesDirectory)/Xamarin.PropertyEditing"
              $matches = Select-String -Path "$srcDir/**/*.resx" -Pattern '\[.*\]\s\(https:.*\)' -AllMatches
              $matchCount = ($matches | Measure-Object -Line).Lines
              Write-Host "Found $matchCount violations."
              $matches | Write-Host
              if( ($matches | Measure-Object -Line).Lines -eq 0 ) {
                Write-Host "Quality Gate Succeeded."
              } else {
                throw "Quality Gate Failure : Check the logs for details."
              }
            displayName: 'Validate Markdown Urls'

          - task: github-merge-pr@1
            inputs:
              github_token: $(GitHub.Token)
              repository: 'xamarin/uitools'
              pr_number: $(pull_request_number)
              merge_method: 'rebase'
            displayName: Merge PR# $(System.PullRequest.PullRequestNumber)