mirror of
https://github.com/actions/actions-runner-controller.git
synced 2026-03-19 08:17:41 +08:00
Set UserAgent to 'actions-runner-controller' for all Http Client. (#1140)
I can't find any requests made by user agent `actions-runner-controller` in GitHub.com's telemetry in the past 7 days. Turns out we only set user agent `actions-runner-controller` if we are configured to use BasicAuth which is not the case for most customers I think. I update the code a little bit to make sure it always set `actions-runner-controller` as UserAgent for the GitHub HttpClient in ARC. A further step would be somehow baking the ARC release version into the UserAgent as well.
This commit is contained in:
@@ -152,3 +152,10 @@ func TestCleanup(t *testing.T) {
|
||||
t.Errorf("expired token still exists")
|
||||
}
|
||||
}
|
||||
|
||||
func TestUserAgent(t *testing.T) {
|
||||
client := newTestClient()
|
||||
if client.UserAgent != "actions-runner-controller" {
|
||||
t.Errorf("UserAgent should be set to actions-runner-controller")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user