<commit_before># intended to be used as part of a release process
parameters:
  ArtifactLocation: 'not-specified'
  PackageRepository: 'not-specified'
  ReleaseSha: 'not-specified'
  RepoId: $(Build.Repository.Name)
  WorkingDirectory: ''
  ScriptDirectory: eng/common/scripts
  TargetDocRepoName: ''
  TargetDocRepoOwner: ''
  PRBranchName: 'master-rdme'
  PRLabels: 'auto-merge'
  ArtifactName: ''
  Language: ''
  DocRepoDestinationPath: '' #usually docs-ref-services/
  CIConfigs: '[]'
  GHReviewersVariable: '' 
  GHTeamReviewersVariable: '' # externally set, as eng-common does not have the identity-resolver. Run as pre-step
  OnboardingBranch: ''
  CloseAfterOpenForTesting: false
  SkipPackageJson: false

steps:
- pwsh: |
    if ($IsWindows) {
      REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /f /v LongPathsEnabled /t REG_DWORD /d 1
      git config --system core.longpaths true
    }
    else {
      Write-Host "This script is not executing on Windows, skipping registry modification."
    }
  displayName: Enable Long Paths if Necessary
  
- pwsh: |
    git clone https://github.com/${{ parameters.TargetDocRepoOwner }}/${{ parameters.TargetDocRepoName }} ${{ parameters.WorkingDirectory }}/repo
  displayName: Clone Documentation Repository
  ignoreLASTEXITCODE: false
- template: /eng/common/pipelines/templates/steps/set-default-branch.yml
  parameters:
    WorkingDirectory: ${{ parameters.WorkingDirectory }}/repo 
- task: PowerShell@2
  displayName: 'Apply Documentation Updates From Artifact'
  inputs:
    targetType: filePath
    filePath: ${{ parameters.ScriptDirectory }}/update-docs-metadata.ps1
    arguments: >
      -ArtifactLocation ${{ parameters.ArtifactLocation }}
      -Repository ${{ parameters.PackageRepository }}
      -ReleaseSHA ${{ parameters.ReleaseSha }}
      -RepoId ${{ parameters.RepoId }}
      -WorkDirectory "${{ parameters.WorkingDirectory }}"
      -DocRepoLocation "${{ parameters.WorkingDirectory }}/repo"
      -Language "${{parameters.Language}}"
      -Configs "${{ parameters.CIConfigs }}"
    pwsh: true
  env:
    GH_TOKEN: $(azuresdk-github-pat)

- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
  parameters:
    BaseRepoBranch: $(DefaultBranch)
    BaseRepoOwner: ${{ parameters.TargetDocRepoOwner }}
    CommitMsg: "Update docs metadata and targeting for release of ${{ parameters.ArtifactName }}"
    TargetRepoName: ${{ parameters.TargetDocRepoName }}
    TargetRepoOwner: ${{ parameters.TargetDocRepoOwner }}
    WorkingDirectory: ${{ parameters.WorkingDirectory }}/repo
    ScriptDirectory: ${{ parameters.WorkingDirectory }}/${{ parameters.ScriptDirectory }}

- ${{if ne( parameters['OnboardingBranch'], '')}}:
  - pwsh: |
      Push-Location ${{ parameters.WorkingDirectory }}/repo
      git reset --hard HEAD
      git remote rm azure-sdk-fork
      git checkout ${{ parameters.OnboardingBranch}}
    displayName: Reset Docs Repo, Checkout Onboarding Branch
    ignoreLASTEXITCODE: false

  - task: PowerShell@2
    displayName: 'Update Docs.MS CI Targeted Packages'
    inputs:
      targetType: filePath
      filePath: ${{ parameters.ScriptDirectory }}/update-docs-ci.ps1
      arguments: >
        -ArtifactLocation ${{ parameters.ArtifactLocation }}
        -WorkDirectory "${{ parameters.WorkingDirectory }}"
        -RepoId ${{ parameters.RepoId }}
        -Repository ${{ parameters.PackageRepository }}
        -ReleaseSHA ${{ parameters.ReleaseSha }}
        -DocRepoLocation "${{ parameters.WorkingDirectory }}/repo"
        -Configs "${{ parameters.CIConfigs }}"
      pwsh: true
    env:
      GH_TOKEN: $(azuresdk-github-pat)
  - template: /eng/common/pipelines/templates/steps/git-push-changes.yml
    parameters:
      BaseRepoBranch: ${{ parameters.OnboardingBranch}}
      BaseRepoOwner: ${{ parameters.TargetDocRepoOwner }}
      CommitMsg: "Update docs metadata and targeting for release of ${{ parameters.ArtifactName }}"
      TargetRepoName: ${{ parameters.TargetDocRepoName }}
      TargetRepoOwner: ${{ parameters.TargetDocRepoOwner }}
      WorkingDirectory: ${{ parameters.WorkingDirectory }}/repo
      ScriptDirectory: ${{ parameters.WorkingDirectory }}/${{ parameters.ScriptDirectory }}<commit_msg>Sync eng/common directory with azure-sdk-tools for PR 1552 (#14522)<commit_after># intended to be used as part of a release process
parameters:
  ArtifactLocation: 'not-specified'
  PackageRepository: 'not-specified'
  ReleaseSha: 'not-specified'
  RepoId: $(Build.Repository.Name)
  WorkingDirectory: ''
  ScriptDirectory: eng/common/scripts
  TargetDocRepoName: ''
  TargetDocRepoOwner: ''
  PRBranchName: 'master-rdme'
  PRLabels: 'auto-merge'
  ArtifactName: ''
  Language: ''
  DocRepoDestinationPath: '' #usually docs-ref-services/
  CIConfigs: '[]'
  GHReviewersVariable: '' 
  GHTeamReviewersVariable: '' # externally set, as eng-common does not have the identity-resolver. Run as pre-step
  OnboardingBranch: ''
  CloseAfterOpenForTesting: false
  SkipPackageJson: false

steps:
- pwsh: |
    if ($IsWindows) {
      REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem /f /v LongPathsEnabled /t REG_DWORD /d 1
      git config --system core.longpaths true
    }
    else {
      Write-Host "This script is not executing on Windows, skipping registry modification."
    }
  displayName: Enable Long Paths if Necessary
  
- pwsh: |
    git clone https://github.com/${{ parameters.TargetDocRepoOwner }}/${{ parameters.TargetDocRepoName }} ${{ parameters.WorkingDirectory }}/repo
  displayName: Clone Documentation Repository
  ignoreLASTEXITCODE: false
- template: /eng/common/pipelines/templates/steps/set-default-branch.yml
  parameters:
    WorkingDirectory: ${{ parameters.WorkingDirectory }}/repo 
- task: PowerShell@2
  displayName: 'Apply Documentation Updates From Artifact'
  inputs:
    targetType: filePath
    filePath: ${{ parameters.ScriptDirectory }}/update-docs-metadata.ps1
    arguments: >
      -ArtifactLocation ${{ parameters.ArtifactLocation }}
      -Repository ${{ parameters.PackageRepository }}
      -ReleaseSHA ${{ parameters.ReleaseSha }}
      -RepoId ${{ parameters.RepoId }}
      -WorkDirectory "${{ parameters.WorkingDirectory }}"
      -DocRepoLocation "${{ parameters.WorkingDirectory }}/repo"
      -Language "${{parameters.Language}}"
      -Configs "${{ parameters.CIConfigs }}"
    pwsh: true
  env:
    GH_TOKEN: $(azuresdk-github-pat)

- template: /eng/common/pipelines/templates/steps/git-push-changes.yml
  parameters:
    BaseRepoBranch: $(DefaultBranch)
    BaseRepoOwner: ${{ parameters.TargetDocRepoOwner }}
    CommitMsg: "Update docs metadata and targeting for release of ${{ parameters.ArtifactName }}"
    TargetRepoName: ${{ parameters.TargetDocRepoName }}
    TargetRepoOwner: ${{ parameters.TargetDocRepoOwner }}
    WorkingDirectory: ${{ parameters.WorkingDirectory }}/repo
    ScriptDirectory: ${{ parameters.WorkingDirectory }}/${{ parameters.ScriptDirectory }}
{'fraction_non_alphanumeric': 0.11995996568487274, 'fraction_numerical': 0.002430654847011724, 'mean_word_length': 3.9295278365045805, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3401341', 'n_tokens_mistral': 2058, 'n_tokens_neox': 1989, 'n_words': 447}