@@ -14,10 +14,11 @@ parameters:
1414 # exist, and any pipeline that sets this to '' fall back to PAT-based auth via the CeapexPat parameter.
1515 CeapexServiceConnection : ' dnceng-onelocbuild-ceapex'
1616
17- # GitHub App authentication for the OneLoc check-in PR (dnceng/internal only) .
18- # The infrastructure identifiers are centralized here and the App path is enabled by default.
19- # DevDiv requires its own project-scoped service connection before this path can be enabled there .
17+ # GitHub App authentication for the OneLoc check-in PR.
18+ # dnceng/internal and DevDiv/DevDiv are enabled by default with their project-scoped service
19+ # connections. Other projects must explicitly opt in after provisioning equivalent infrastructure .
2020 UseGitHubAppAuthentication : true
21+ UseGitHubAppAuthenticationInOtherProjects : false
2122 GitHubAppServiceConnection : ' dnceng-oneloc-githubapp'
2223 GitHubAppClientId : ' Iv23lijBU8x3gc9lDOc9'
2324 GitHubAppKeyVaultName : ' EngKeyVault'
@@ -97,13 +98,16 @@ jobs:
9798 outputVariableName : ' CeapexEntraToken'
9899 condition : ${{ parameters.condition }}
99100
100- # Mint a short-lived GitHub App installation token for the loc check-in PR (dnceng/internal only).
101- # All other projects fall back to PAT-based auth, since the app service connection is scoped to dnceng/internal .
102- - ${{ if and(eq(parameters.RepoType, 'gitHub'), eq(parameters.UseGitHubAppAuthentication, true), eq(variables['System.TeamProject'], 'internal')) }} :
101+ # Mint a short-lived GitHub App installation token for the loc check-in PR. Use the connection
102+ # provisioned in each supported project; other projects must explicitly opt in and override it .
103+ - ${{ if and(eq(parameters.RepoType, 'gitHub'), eq(parameters.UseGitHubAppAuthentication, true), or( eq(variables['System.TeamProject'], 'internal'), eq(variables['System.TeamProject'], 'DevDiv'), eq(parameters.UseGitHubAppAuthenticationInOtherProjects, true) )) }} :
103104 - template : /eng/common/core-templates/steps/get-github-app-token.yml
104105 parameters :
105106 is1ESPipeline : ${{ parameters.is1ESPipeline }}
106- azureSubscription : ${{ parameters.GitHubAppServiceConnection }}
107+ ${{ if and(eq(variables['System.TeamProject'], 'DevDiv'), eq(parameters.GitHubAppServiceConnection, 'dnceng-oneloc-githubapp')) }} :
108+ azureSubscription : ' devdiv-oneloc-githubapp'
109+ ${{ else }} :
110+ azureSubscription : ${{ parameters.GitHubAppServiceConnection }}
107111 keyVaultName : ${{ parameters.GitHubAppKeyVaultName }}
108112 keyName : ${{ parameters.GitHubAppKeyName }}
109113 appClientId : ${{ parameters.GitHubAppClientId }}
@@ -132,9 +136,9 @@ jobs:
132136 patVariable : ${{ parameters.CeapexPat }}
133137 ${{ if eq(parameters.RepoType, 'gitHub') }} :
134138 repoType : ${{ parameters.RepoType }}
135- ${{ if and(eq(parameters.UseGitHubAppAuthentication, true), eq(variables['System.TeamProject'], 'internal')) }} :
139+ ${{ if and(eq(parameters.UseGitHubAppAuthentication, true), or( eq(variables['System.TeamProject'], 'internal'), eq(variables['System.TeamProject'], 'DevDiv'), eq(parameters.UseGitHubAppAuthenticationInOtherProjects, true) )) }} :
136140 gitHubPatVariable : " $(GitHubAppInstallationToken)"
137- ${{ if or(eq(parameters.UseGitHubAppAuthentication, false), ne(variables['System.TeamProject'], 'internal')) }} :
141+ ${{ else }} :
138142 gitHubPatVariable : " ${{ parameters.GithubPat }}"
139143 ${{ if ne(parameters.MirrorRepo, '') }} :
140144 isMirrorRepoSelected : true
0 commit comments