diff --git a/tools/build/BuildDefinition.cs b/tools/build/BuildDefinition.cs index a8084818..cd10de4f 100644 --- a/tools/build/BuildDefinition.cs +++ b/tools/build/BuildDefinition.cs @@ -439,8 +439,13 @@ public static void Document(Options options) "); } - private static string GitHubRepository => Environment.GetEnvironmentVariable("GITHUB_REPOSITORY") ?? "aaubry/YamlDotNet.Sandbox"; - + private static string GitHubRepository => + Program.Host switch + { + Host.Appveyor => Environment.GetEnvironmentVariable("APPVEYOR_REPO_NAME"), + _ => Environment.GetEnvironmentVariable("GITHUB_REPOSITORY") + } + ?? "aaubry/YamlDotNet.Sandbox"; private static readonly Lazy GitHubClient = new Lazy(() => { diff --git a/tools/build/Program.cs b/tools/build/Program.cs index 962667d7..e29c7e3e 100644 --- a/tools/build/Program.cs +++ b/tools/build/Program.cs @@ -22,7 +22,7 @@ class Program public static bool NoPrerelease { get; private set; } public static string? ForcedVersion { get; private set; } private static bool verbose; - private static Host host; + public static Host Host { get; private set; } private static readonly Dictionary state = new Dictionary(); private static T GetState() where T : notnull @@ -136,7 +136,7 @@ static int Main(string[] args) var (options, targets) = Options.Parse(filteredArguments); verbose = options.Verbose; - host = options.Host.DetectIfUnknown().Item1; + Host = options.Host.DetectIfUnknown().Item1; var operatingSystem = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) @@ -234,7 +234,7 @@ public static void WriteWarning(string text) public static void WriteImportant(string text) { - switch (host) + switch (Host) { case Host.GitHubActions: Console.WriteLine($"Writing a warning");