From 82ffc3119034fd993ffa1b5b4a7aad79573841e6 Mon Sep 17 00:00:00 2001 From: Jon Fortescue Date: Mon, 25 Oct 2021 15:59:13 -0700 Subject: [PATCH] Make OneLocBuild reuse existing PRs --- Documentation/OneLocBuild.md | 1 + eng/common/templates/job/onelocbuild.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Documentation/OneLocBuild.md b/Documentation/OneLocBuild.md index ac01217de9b..978756d402a 100644 --- a/Documentation/OneLocBuild.md +++ b/Documentation/OneLocBuild.md @@ -164,6 +164,7 @@ The parameters that can be passed to the template are as follows: | `SourcesDirectory` | `$(Build.SourcesDirectory)` | This is the root directory for your repository source code. | | `CreatePr` | `true` | When set to `true`, instructs the OneLocBuild task to make a PR back to the source repository containing the localized files. | | `AutoCompletePr` | `false` | When set to `true`, instructs the OneLocBuild task to autocomplete the created PR. Requires permissions to bypass any checks on the main branch. | +| `ReusePr` | `true` | When set to `true`, instructs the OneLocBuild task to update an existing PR (if one exists) rather than open a new one to reduce PR noise. | | `UseLfLineEndings` | `true` | When set to `true`, instructs the OneLocBuild task to use LF line endings during check-in rather than CRLF. | | `GitHubOrg` | `'dotnet'` | The GitHub organization to be used when making a PR (only used when using a mirrored repository). | | `MirrorRepo` | `''` | The name of the GitHub repository to make a PR to (only used when using a mirrored repository). | diff --git a/eng/common/templates/job/onelocbuild.yml b/eng/common/templates/job/onelocbuild.yml index e8bc77d2ebb..a842886629b 100644 --- a/eng/common/templates/job/onelocbuild.yml +++ b/eng/common/templates/job/onelocbuild.yml @@ -12,6 +12,7 @@ parameters: SourcesDirectory: $(Build.SourcesDirectory) CreatePr: true AutoCompletePr: false + ReusePr: true UseLfLineEndings: true UseCheckedInLocProjectJson: false LanguageSet: VS_Main_Languages @@ -64,6 +65,8 @@ jobs: ${{ if eq(parameters.CreatePr, true) }}: isAutoCompletePrSelected: ${{ parameters.AutoCompletePr }} isUseLfLineEndingsSelected: ${{ parameters.UseLfLineEndings }} + ${{ if eq(parameters.RepoType, 'gitHub') }}: + isShouldReusePrSelected: ${{ parameters.ReusePr }} packageSourceAuth: patAuth patVariable: ${{ parameters.CeapexPat }} ${{ if eq(parameters.RepoType, 'gitHub') }}: