Skip to content

Commit

Permalink
Github Actions: Use Environment File
Browse files Browse the repository at this point in the history
  • Loading branch information
talenfisher committed Oct 5, 2020
1 parent 4607417 commit f9d5b5f
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, $"{name}={value}{Environment.NewLine}");
return GetDictionaryFor(name, value);
}

Expand Down

0 comments on commit f9d5b5f

Please sign in to comment.