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

Commit

Permalink
commiter message
Browse files Browse the repository at this point in the history
  • Loading branch information
OpportunityLiu committed Jun 12, 2020
1 parent bffdcab commit e2a2f2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions EhTagClient/Consts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ public static class Consts

public static string Username { get; }
public static string Password { get; }
public static string Email { get; }

public static string Token { get; }

public static string CommitterName { get; }
public static string CommitterEmail { get; }

public static JsonSerializerSettings SerializerSettings => new JsonSerializerSettings
{
ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver
Expand All @@ -36,8 +39,11 @@ static Consts()
{
Username = _GetString("GitHub:Username");
Password = _GetString("GitHub:Password");
Email = _GetString("GitHub:Email");

Token = _GetString("GitHub:Token");

CommitterName = _GetString("GitHub:CommitterName");
CommitterEmail = _GetString("GitHub:CommitterEmail");
}

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

if (string.IsNullOrEmpty(ev))
{
Console.WriteLine($"Environment variable `{key}` not found.");
return null;
}
return ev;
}
}
Expand Down
2 changes: 1 addition & 1 deletion EhTagClient/RepoClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ private readonly LibGit2Sharp.Handlers.CredentialsHandler CredentialsProvider
};
};

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

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

Expand Down

0 comments on commit e2a2f2c

Please sign in to comment.