Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 4a87176

Browse files
Octorun user-agent changes
1 parent b634318 commit 4a87176

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

octorun/.env.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
OCTOKIT_CLIENT_ID=
22
OCTOKIT_CLIENT_SECRET=
3+
OCTOKIT_USER_AGENT=
34
OCTORUN_USER=
45
OCTORUN_TOKEN=

octorun/src/authentication.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ var handleTwoFactorAuthentication = function (username, password, twoFactor, onS
5454

5555
octokit.authorization.create({
5656
scopes: scopes,
57-
note: config.appName,
5857
client_id: config.clientId,
5958
client_secret: config.clientSecret,
6059
headers: {
61-
"X-GitHub-OTP": twoFactor
60+
"X-GitHub-OTP": twoFactor,
61+
"user-agent": config.appName
6262
}
6363
}, function (err, res) {
6464
if (err) {

octorun/src/configuration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ require("dotenv").config({silent: true});
22

33
var clientId = process.env.OCTOKIT_CLIENT_ID;
44
var clientSecret = process.env.OCTOKIT_CLIENT_SECRET;
5-
var appName = process.env.OCTORUN_APP_NAME | "octorun";
5+
var appName = process.env.OCTOKIT_USER_AGENT | "octorun";
66
var user = process.env.OCTORUN_USER;
77
var token = process.env.OCTORUN_TOKEN;
88

src/GitHub.Api/Tasks/OctorunTask.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections.Generic;
22
using System.Diagnostics;
3+
using System.Reflection;
34
using System.Threading;
45

56
namespace GitHub.Unity
@@ -29,6 +30,8 @@ public override void Configure(ProcessStartInfo psi)
2930
{
3031
base.Configure(psi);
3132

33+
psi.EnvironmentVariables.Add("OCTOKIT_USER_AGENT", ApplicationInfo.ApplicationSafeName+ AssemblyName.Version.ToString());
34+
3235
if (clientId != null)
3336
{
3437
psi.EnvironmentVariables.Add("OCTOKIT_CLIENT_ID", clientId);

0 commit comments

Comments
 (0)