Skip to content
This repository was archived by the owner on Jul 3, 2020. It is now read-only.

Commit e2a2f2c

Browse files
commiter message
1 parent bffdcab commit e2a2f2c

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

EhTagClient/Consts.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ public static class Consts
1313

1414
public static string Username { get; }
1515
public static string Password { get; }
16-
public static string Email { get; }
16+
1717
public static string Token { get; }
1818

19+
public static string CommitterName { get; }
20+
public static string CommitterEmail { get; }
21+
1922
public static JsonSerializerSettings SerializerSettings => new JsonSerializerSettings
2023
{
2124
ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver
@@ -36,8 +39,11 @@ static Consts()
3639
{
3740
Username = _GetString("GitHub:Username");
3841
Password = _GetString("GitHub:Password");
39-
Email = _GetString("GitHub:Email");
42+
4043
Token = _GetString("GitHub:Token");
44+
45+
CommitterName = _GetString("GitHub:CommitterName");
46+
CommitterEmail = _GetString("GitHub:CommitterEmail");
4147
}
4248

4349
private static string _GetString(string key)
@@ -47,7 +53,10 @@ private static string _GetString(string key)
4753
?? Environment.GetEnvironmentVariable(key, EnvironmentVariableTarget.Machine);
4854

4955
if (string.IsNullOrEmpty(ev))
56+
{
5057
Console.WriteLine($"Environment variable `{key}` not found.");
58+
return null;
59+
}
5160
return ev;
5261
}
5362
}

EhTagClient/RepoClient.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private readonly LibGit2Sharp.Handlers.CredentialsHandler CredentialsProvider
6565
};
6666
};
6767

68-
public Identity CommandIdentity => new Identity(Consts.Username, Consts.Email);
68+
public Identity CommandIdentity => new Identity(Consts.CommitterName, Consts.CommitterEmail);
6969

7070
public string CurrentSha => Repo.Commits.First().Sha;
7171

0 commit comments

Comments
 (0)