@@ -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'
@@ -98,13 +99,16 @@ jobs:
9899 outputVariableName : ' CeapexEntraToken'
99100 condition : ${{ parameters.condition }}
100101
101- # Mint a short-lived GitHub App installation token for the loc check-in PR (dnceng/internal only).
102- # All other projects fall back to PAT-based auth, since the app service connection is scoped to dnceng/internal .
103- - ${{ if and(eq(parameters.RepoType, 'gitHub'), eq(parameters.UseGitHubAppAuthentication, true), eq(variables['System.TeamProject'], 'internal')) }} :
102+ # Mint a short-lived GitHub App installation token for the loc check-in PR. Use the connection
103+ # provisioned in each supported project; other projects must explicitly opt in and override it .
104+ - ${{ 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) )) }} :
104105 - template : /eng/common/core-templates/steps/get-github-app-token.yml
105106 parameters :
106107 is1ESPipeline : ${{ parameters.is1ESPipeline }}
107- azureSubscription : ${{ parameters.GitHubAppServiceConnection }}
108+ ${{ if and(eq(variables['System.TeamProject'], 'DevDiv'), eq(parameters.GitHubAppServiceConnection, 'dnceng-oneloc-githubapp')) }} :
109+ azureSubscription : ' devdiv-oneloc-githubapp'
110+ ${{ else }} :
111+ azureSubscription : ${{ parameters.GitHubAppServiceConnection }}
108112 keyVaultName : ${{ parameters.GitHubAppKeyVaultName }}
109113 keyName : ${{ parameters.GitHubAppKeyName }}
110114 appClientId : ${{ parameters.GitHubAppClientId }}
@@ -133,9 +137,9 @@ jobs:
133137 patVariable : ${{ parameters.CeapexPat }}
134138 ${{ if eq(parameters.RepoType, 'gitHub') }} :
135139 repoType : ${{ parameters.RepoType }}
136- ${{ if and(eq(parameters.UseGitHubAppAuthentication, true), eq(variables['System.TeamProject'], 'internal')) }} :
140+ ${{ if and(eq(parameters.UseGitHubAppAuthentication, true), or( eq(variables['System.TeamProject'], 'internal'), eq(variables['System.TeamProject'], 'DevDiv'), eq(parameters.UseGitHubAppAuthenticationInOtherProjects, true) )) }} :
137141 gitHubPatVariable : " $(GitHubAppInstallationToken)"
138- ${{ if or(eq(parameters.UseGitHubAppAuthentication, false), ne(variables['System.TeamProject'], 'internal')) }} :
142+ ${{ else }} :
139143 gitHubPatVariable : " ${{ parameters.GithubPat }}"
140144 ${{ if ne(parameters.MirrorRepo, '') }} :
141145 isMirrorRepoSelected : true
0 commit comments