forked from actions/runner
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the API_URL and munge action URLs for GHES (actions#437)
* First pass at logic for GHES, not all correct * Need to mock out file downloading * Allowed for mocking of HTTP responses * Added test for builtin GHES action download * More tests * Don't retry on action 404 * Remove commented out code * Add a using statement back, because Windows * Make windows happy again * Another windows fix * Always delete the cache since it isn't fully implemented * Use RunnerService base class * Add examples, update URL path * Remove forceDotCom * Fix a bug * Remove a test that's no longer relevant * PR feedback * Add missing return * More trace info * Use the new agreed-upon format * Use the auth token since we're hitting GHES directly * Fixing tests on windows * Fixed one more test
- Loading branch information
Showing
6 changed files
with
426 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using System.Net.Http; | ||
using GitHub.Runner.Sdk; | ||
|
||
namespace GitHub.Runner.Common | ||
{ | ||
[ServiceLocator(Default = typeof(HttpClientHandlerFactory))] | ||
public interface IHttpClientHandlerFactory : IRunnerService | ||
{ | ||
HttpClientHandler CreateClientHandler(RunnerWebProxy webProxy); | ||
} | ||
|
||
public class HttpClientHandlerFactory : RunnerService, IHttpClientHandlerFactory | ||
{ | ||
public HttpClientHandler CreateClientHandler(RunnerWebProxy webProxy) | ||
{ | ||
return new HttpClientHandler() { Proxy = webProxy }; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Runtime.Serialization; | ||
|
||
namespace GitHub.Runner.Worker | ||
{ | ||
public class ActionNotFoundException : Exception | ||
{ | ||
public ActionNotFoundException(Uri actionUri) | ||
: base(FormatMessage(actionUri)) | ||
{ | ||
} | ||
|
||
public ActionNotFoundException(string message) | ||
: base(message) | ||
{ | ||
} | ||
|
||
public ActionNotFoundException(string message, System.Exception inner) | ||
: base(message, inner) | ||
{ | ||
} | ||
|
||
protected ActionNotFoundException(SerializationInfo info, StreamingContext context) | ||
: base(info, context) | ||
{ | ||
} | ||
|
||
private static string FormatMessage(Uri actionUri) | ||
{ | ||
return $"An action could not be found at the URI '{actionUri}'"; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.