Skip to content

Commit

Permalink
Merge pull request #516 from talenfisher/gha-env-file
Browse files Browse the repository at this point in the history
Github Actions: Use Environment File
  • Loading branch information
AArnott authored Oct 6, 2020
2 parents 4607417 + 795f5df commit 06cc627
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ internal class GitHubActions : ICloudBuild

private static string BuildingRef => Environment.GetEnvironmentVariable("GITHUB_REF");

private static string EnvironmentFile => Environment.GetEnvironmentVariable("GITHUB_ENV");

public IReadOnlyDictionary<string, string> SetCloudBuildNumber(string buildNumber, TextWriter stdout, TextWriter stderr)
{
return new Dictionary<string, string>();
}

public IReadOnlyDictionary<string, string> SetCloudBuildVariable(string name, string value, TextWriter stdout, TextWriter stderr)
{
(stdout ?? Console.Out).WriteLine($"##[set-env name={name};]{value}");
File.AppendAllText(EnvironmentFile, $"{Environment.NewLine}{name}={value}{Environment.NewLine}");
return GetDictionaryFor(name, value);
}

Expand Down

0 comments on commit 06cc627

Please sign in to comment.