Skip to content

Commit

Permalink
Use GitHub Token, closes #60
Browse files Browse the repository at this point in the history
  • Loading branch information
cd21h committed Feb 8, 2020
1 parent 702b0f7 commit 943c3b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
9 changes: 3 additions & 6 deletions .build/definitions.cake
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public class BuildInfo {

public RepositoryInfo Repository { get; protected set; }

public Credentials GitHubCredentials { get; protected set; }
public string GitHubToken { get; protected set; }

public Paths Paths { get; protected set; }

Expand All @@ -164,10 +164,7 @@ public class BuildInfo {
semVersion.MajorMinorPatch
);

var githubCredentials = new Credentials(
context.EnvironmentVariable("GITHUB_USER"),
context.EnvironmentVariable("GITHUB_PASSWORD")
);
var gitHubToken = context.EnvironmentVariable("GITHUB_TOKEN");

return new BuildInfo {
Target = target,
Expand All @@ -178,7 +175,7 @@ public class BuildInfo {
AppVeyorJobId = buildSystem.AppVeyor.Environment.JobId,
Version = version,
Repository = RepositoryInfo.Get(buildSystem, settings),
GitHubCredentials = githubCredentials,
GitHubToken = gitHubToken,
Settings = settings,
Paths = new Paths(context),
};
Expand Down
4 changes: 2 additions & 2 deletions .build/tasks.cake
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ Task("CreateRelease")
.Does<BuildInfo>(build =>
{
GitReleaseManagerCreate(
build.GitHubCredentials.UserName, build.GitHubCredentials.Password,
build.GitHubToken,
build.Settings.RepoOwner, build.Settings.RepoName,
new GitReleaseManagerCreateSettings {
Milestone = build.Version.Milestone,
Expand All @@ -199,7 +199,7 @@ Task("CloseMilestone")
.Does<BuildInfo>(build =>
{
GitReleaseManagerClose(
build.GitHubCredentials.UserName, build.GitHubCredentials.Password,
build.GitHubToken,
build.Settings.RepoOwner, build.Settings.RepoName,
build.Version.Milestone
);
Expand Down
6 changes: 2 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ environment:
coveralls_repo_token:
secure: PPV4OTsE0mqUJQ5UXY8dKJnifv+488XNxe7rtyUbiYJNMgvOooUZvGeSxhsOIJmJ
CAKE_SETTINGS_SKIPVERIFICATION: true
GITHUB_USER:
secure: 5NfHPjw31vB/XxJqwpHp3cl3n/9F7PTUVXhMIqRSDJE=
GITHUB_PASSWORD:
secure: 9gArAAMTQRHIsSZcJ+87GM+kaSfsBlouuFHtBR1hWBY=
GITHUB_TOKEN:
secure: SakrMxbclSjNzFQxv8sA35OhulfvNm9VqHBEOgQrebPaF/Bv7AmZRsT8/YEfSQED

install:
- ps: ./dotnet-install.ps1 -Version 3.1.101 -InstallDir "C:\Program Files\dotnet"
Expand Down

0 comments on commit 943c3b6

Please sign in to comment.