Skip to content

Commit

Permalink
Merge pull request #727 from Hugo-Dahl-Tyler/bugfix/GitHubActions-Fil…
Browse files Browse the repository at this point in the history
…e-Output-Has-Redundant-Entries

GitHub actions file output has redundant entries
  • Loading branch information
AArnott committed Mar 6, 2022
2 parents 06fb918 + b6e44c3 commit d66ac53
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Expand Up @@ -28,7 +28,7 @@ internal class GitHubActions : ICloudBuild

public IReadOnlyDictionary<string, string> SetCloudBuildVariable(string name, string value, TextWriter stdout, TextWriter stderr)
{
Utilities.FileOperationWithRetry(() => File.AppendAllText(EnvironmentFile, $"{Environment.NewLine}{name}={value}{Environment.NewLine}"));
Utilities.FileOperationWithRetry(() => File.AppendAllLines(EnvironmentFile, new [] {$"{name}={value}"}));
return GetDictionaryFor(name, value);
}

Expand Down
1 change: 1 addition & 0 deletions src/Shared/Utilities.cs
Expand Up @@ -19,6 +19,7 @@ internal static void FileOperationWithRetry(Action operation)
try
{
operation();
break;
}
catch (IOException ex) when (ex.HResult == ProcessCannotAccessFileHR && retriesLeft > 0)
{
Expand Down

0 comments on commit d66ac53

Please sign in to comment.