diff --git a/eng/common/pipelines/templates/steps/create-pull-request.yml b/eng/common/pipelines/templates/steps/create-pull-request.yml index b22d5dda2722..a60d26c8fe98 100644 --- a/eng/common/pipelines/templates/steps/create-pull-request.yml +++ b/eng/common/pipelines/templates/steps/create-pull-request.yml @@ -7,7 +7,7 @@ parameters: PROwner: azure-sdk CommitMsg: not-specified RepoOwner: Azure - RepoName: not-specified + RepoName: $(Build.Repository.Name) PushArgs: WorkingDirectory: $(System.DefaultWorkingDirectory) PRTitle: not-specified @@ -36,6 +36,11 @@ steps: echo "No changes so skipping code push" } + # Remove the repo owner from the front of the repo name if it exists there + $repoName = "${{ parameters.RepoName }}" -replace "^${{ parameters.RepoOwner }}/", "" + echo "##vso[task.setvariable variable=RepoNameWithoutOwner]$repoName" + echo "RepoName = $repName" + displayName: Check for changes workingDirectory: ${{ parameters.WorkingDirectory }} ignoreLASTEXITCODE: true @@ -50,7 +55,7 @@ steps: arguments: > -PRBranchName "${{ parameters.PRBranchName }}" -CommitMsg "${{ parameters.CommitMsg }}" - -GitUrl "https://$(azuresdk-github-pat)@github.com/${{ parameters.PROwner }}/${{ parameters.RepoName }}.git" + -GitUrl "https://$(azuresdk-github-pat)@github.com/${{ parameters.PROwner }}/$(RepoNameWithoutOwner).git" -PushArgs "${{ parameters.PushArgs }}" - task: PowerShell@2 @@ -62,7 +67,7 @@ steps: filePath: ${{ parameters.ScriptDirectory }}/Submit-PullRequest.ps1 arguments: > -RepoOwner "${{ parameters.RepoOwner }}" - -RepoName "${{ parameters.RepoName }}" + -RepoName "$(RepoNameWithoutOwner)" -BaseBranch "${{ parameters.BaseBranchName }}" -PROwner "${{ parameters.PROwner }}" -PRBranch "${{ parameters.PRBranchName }}" @@ -81,7 +86,7 @@ steps: filePath: ${{ parameters.ScriptDirectory }}/add-pullrequest-reviewers.ps1 arguments: > -RepoOwner "${{ parameters.RepoOwner }}" - -RepoName "${{ parameters.RepoName }}" + -RepoName "$(RepoNameWithoutOwner)" -AuthToken "$(azuresdk-github-pat)" -GitHubUsers "$(${{ parameters.GHReviewersVariable }})" -GitHubTeams "$(${{ parameters.GHTeamReviewersVariable }})" diff --git a/eng/common/pipelines/templates/steps/create-tags-and-git-release.yml b/eng/common/pipelines/templates/steps/create-tags-and-git-release.yml index 8fb57243b0fd..5da9c29f55a9 100644 --- a/eng/common/pipelines/templates/steps/create-tags-and-git-release.yml +++ b/eng/common/pipelines/templates/steps/create-tags-and-git-release.yml @@ -2,7 +2,7 @@ parameters: ArtifactLocation: 'not-specified' PackageRepository: 'not-specified' ReleaseSha: 'not-specified' - RepoId: 'not-specified' + RepoId: $(Build.Repository.Name) WorkingDirectory: '' ScriptDirectory: eng/common/scripts diff --git a/eng/common/pipelines/templates/steps/docs-metadata-release.yml b/eng/common/pipelines/templates/steps/docs-metadata-release.yml index 3f5927afc044..182afaee91df 100644 --- a/eng/common/pipelines/templates/steps/docs-metadata-release.yml +++ b/eng/common/pipelines/templates/steps/docs-metadata-release.yml @@ -3,7 +3,7 @@ parameters: ArtifactLocation: 'not-specified' PackageRepository: 'not-specified' ReleaseSha: 'not-specified' - RepoId: 'not-specified' + RepoId: $(Build.Repository.Name) WorkingDirectory: '' ScriptDirectory: eng/common/scripts TargetDocRepoName: '' diff --git a/eng/common/pipelines/templates/steps/replace-relative-links.yml b/eng/common/pipelines/templates/steps/replace-relative-links.yml index fe90211c8c6c..9df78e1f628e 100644 --- a/eng/common/pipelines/templates/steps/replace-relative-links.yml +++ b/eng/common/pipelines/templates/steps/replace-relative-links.yml @@ -2,7 +2,7 @@ parameters: TargetFolder: '' RootFolder: '' BuildSHA: '' - RepoId: '' + RepoId: $(Build.Repository.Name) steps: - task: PythonScript@0