-
Couldn't load subscription status.
- Fork 1.2k
Prevent falling back to default token for onprem #3997
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
eecd2b5
e93084b
da9ea27
08cd325
2c13c85
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -739,13 +739,31 @@ private async Task BuildActionContainerAsync(IExecutionContext executionContext, | |||||
| ArgUtil.NotNull(actionDownloadInfos.Actions, nameof(actionDownloadInfos.Actions)); | ||||||
| var defaultAccessToken = executionContext.GetGitHubContext("token"); | ||||||
|
|
||||||
| // Get GitHub URL for OnPrem fallback logic | ||||||
| UriBuilder gitHubUrl = null; | ||||||
| var serverUrl = executionContext.GetGitHubContext("server_url"); | ||||||
| if (!string.IsNullOrEmpty(serverUrl)) | ||||||
| { | ||||||
| gitHubUrl = new UriBuilder(serverUrl); | ||||||
| } | ||||||
| else | ||||||
| { | ||||||
| // Fallback to runner settings if GitHub context doesn't have server_url | ||||||
| var configurationStore = HostContext.GetService<IConfigurationStore>(); | ||||||
| var runnerSettings = configurationStore.GetSettings(); | ||||||
| if (!string.IsNullOrEmpty(runnerSettings.GitHubUrl)) | ||||||
| { | ||||||
| gitHubUrl = new UriBuilder(runnerSettings.GitHubUrl); | ||||||
| } | ||||||
| } | ||||||
|
|
||||||
| foreach (var actionDownloadInfo in actionDownloadInfos.Actions.Values) | ||||||
| { | ||||||
| // Add secret | ||||||
| HostContext.SecretMasker.AddValue(actionDownloadInfo.Authentication?.Token); | ||||||
|
|
||||||
| // Default auth token | ||||||
| if (string.IsNullOrEmpty(actionDownloadInfo.Authentication?.Token)) | ||||||
| // Use default auth token unless falling back from OnPrem | ||||||
| if (string.IsNullOrEmpty(actionDownloadInfo.Authentication?.Token) && !UrlUtil.IsGHECDRFallbackToDotcom(gitHubUrl, actionDownloadInfo)) | ||||||
|
||||||
| if (string.IsNullOrEmpty(actionDownloadInfo.Authentication?.Token) && !UrlUtil.IsGHECDRFallbackToDotcom(gitHubUrl, actionDownloadInfo)) | |
| if (string.IsNullOrEmpty(actionDownloadInfo.Authentication?.Token) && (gitHubUrl == null || !UrlUtil.IsGHECDRFallbackToDotcom(gitHubUrl, actionDownloadInfo))) |
Uh oh!
There was an error while loading. Please reload this page.