From 5bb20cd94c3e405d6df159cb1a0f84f76e67a2cb Mon Sep 17 00:00:00 2001 From: TingluoHuang Date: Tue, 14 Jul 2020 13:37:20 -0400 Subject: [PATCH] rename master to main. --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 2 +- src/Test/L0/Worker/ActionManagerL0.cs | 40 +++++++++---------- src/Test/L0/Worker/ActionManifestManagerL0.cs | 4 +- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5320b3797..041670d6c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: push: branches: - - master + - main - releases/* paths-ignore: - '**.md' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 726e4487f..240d549f6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: jobs: check: - if: startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/master' + if: startsWith(github.ref, 'refs/heads/releases/') || github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 diff --git a/src/Test/L0/Worker/ActionManagerL0.cs b/src/Test/L0/Worker/ActionManagerL0.cs index b1ccb284b..cfdd306e1 100644 --- a/src/Test/L0/Worker/ActionManagerL0.cs +++ b/src/Test/L0/Worker/ActionManagerL0.cs @@ -133,7 +133,7 @@ namespace GitHub.Runner.Common.Tests.Worker Reference = new Pipelines.RepositoryPathReference() { Name = ActionName, - Ref = "master", + Ref = "main", RepositoryType = "GitHub" } } @@ -141,7 +141,7 @@ namespace GitHub.Runner.Common.Tests.Worker // Return a valid action from GHES via mock const string ApiUrl = "https://ghes.example.com/api/v3"; - string expectedArchiveLink = GetLinkToActionArchive(ApiUrl, ActionName, "master"); + string expectedArchiveLink = GetLinkToActionArchive(ApiUrl, ActionName, "main"); string archiveFile = await CreateRepoArchive(); using var stream = File.OpenRead(archiveFile); var mockClientHandler = new Mock(); @@ -159,10 +159,10 @@ namespace GitHub.Runner.Common.Tests.Worker await _actionManager.PrepareActionsAsync(_ec.Object, actions); //Assert - var watermarkFile = Path.Combine(_hc.GetDirectory(WellKnownDirectory.Actions), ActionName, "master.completed"); + var watermarkFile = Path.Combine(_hc.GetDirectory(WellKnownDirectory.Actions), ActionName, "main.completed"); Assert.True(File.Exists(watermarkFile)); - var actionYamlFile = Path.Combine(_hc.GetDirectory(WellKnownDirectory.Actions), ActionName, "master", "action.yml"); + var actionYamlFile = Path.Combine(_hc.GetDirectory(WellKnownDirectory.Actions), ActionName, "main", "action.yml"); Assert.True(File.Exists(actionYamlFile)); _hc.GetTrace().Info(File.ReadAllText(actionYamlFile)); } @@ -191,7 +191,7 @@ namespace GitHub.Runner.Common.Tests.Worker Reference = new Pipelines.RepositoryPathReference() { Name = ActionName, - Ref = "master", + Ref = "main", RepositoryType = "GitHub" } } @@ -199,8 +199,8 @@ namespace GitHub.Runner.Common.Tests.Worker // Return a valid action from GHES via mock const string ApiUrl = "https://ghes.example.com/api/v3"; - string builtInArchiveLink = GetLinkToActionArchive(ApiUrl, ActionName, "master"); - string dotcomArchiveLink = GetLinkToActionArchive("https://api.github.com", ActionName, "master"); + string builtInArchiveLink = GetLinkToActionArchive(ApiUrl, ActionName, "main"); + string dotcomArchiveLink = GetLinkToActionArchive("https://api.github.com", ActionName, "main"); string archiveFile = await CreateRepoArchive(); using var stream = File.OpenRead(archiveFile); var mockClientHandler = new Mock(); @@ -220,10 +220,10 @@ namespace GitHub.Runner.Common.Tests.Worker await _actionManager.PrepareActionsAsync(_ec.Object, actions); //Assert - var watermarkFile = Path.Combine(_hc.GetDirectory(WellKnownDirectory.Actions), ActionName, "master.completed"); + var watermarkFile = Path.Combine(_hc.GetDirectory(WellKnownDirectory.Actions), ActionName, "main.completed"); Assert.True(File.Exists(watermarkFile)); - var actionYamlFile = Path.Combine(_hc.GetDirectory(WellKnownDirectory.Actions), ActionName, "master", "action.yml"); + var actionYamlFile = Path.Combine(_hc.GetDirectory(WellKnownDirectory.Actions), ActionName, "main", "action.yml"); Assert.True(File.Exists(actionYamlFile)); _hc.GetTrace().Info(File.ReadAllText(actionYamlFile)); } @@ -252,7 +252,7 @@ namespace GitHub.Runner.Common.Tests.Worker Reference = new Pipelines.RepositoryPathReference() { Name = ActionName, - Ref = "master", + Ref = "main", RepositoryType = "GitHub" } } @@ -260,7 +260,7 @@ namespace GitHub.Runner.Common.Tests.Worker // Return a valid action from GHES via mock const string ApiUrl = "https://ghes.example.com/api/v3"; - string archiveLink = GetLinkToActionArchive(ApiUrl, ActionName, "master"); + string archiveLink = GetLinkToActionArchive(ApiUrl, ActionName, "main"); string archiveFile = await CreateRepoArchive(); using var stream = File.OpenRead(archiveFile); var mockClientHandler = new Mock(); @@ -280,10 +280,10 @@ namespace GitHub.Runner.Common.Tests.Worker //Assert await Assert.ThrowsAsync(action); - var watermarkFile = Path.Combine(_hc.GetDirectory(WellKnownDirectory.Actions), ActionName, "master.completed"); + var watermarkFile = Path.Combine(_hc.GetDirectory(WellKnownDirectory.Actions), ActionName, "main.completed"); Assert.False(File.Exists(watermarkFile)); - var actionYamlFile = Path.Combine(_hc.GetDirectory(WellKnownDirectory.Actions), ActionName, "master", "action.yml"); + var actionYamlFile = Path.Combine(_hc.GetDirectory(WellKnownDirectory.Actions), ActionName, "main", "action.yml"); Assert.False(File.Exists(actionYamlFile)); } finally @@ -1278,7 +1278,7 @@ runs: "; Pipelines.ActionStep instance; string directory; - directory = Path.Combine(_workFolder, Constants.Path.ActionsDirectory, "GitHub/actions".Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar), "master"); + directory = Path.Combine(_workFolder, Constants.Path.ActionsDirectory, "GitHub/actions".Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar), "main"); string file = Path.Combine(directory, Constants.Path.ActionManifestYamlFile); Directory.CreateDirectory(Path.GetDirectoryName(file)); File.WriteAllText(file, Content); @@ -1288,7 +1288,7 @@ runs: Reference = new Pipelines.RepositoryPathReference() { Name = "GitHub/actions", - Ref = "master", + Ref = "main", RepositoryType = Pipelines.RepositoryTypes.GitHub } }; @@ -2898,7 +2898,7 @@ runs: "; Pipelines.ActionStep instance; string directory; - directory = Path.Combine(_workFolder, Constants.Path.ActionsDirectory, "GitHub/actions".Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar), "master"); + directory = Path.Combine(_workFolder, Constants.Path.ActionsDirectory, "GitHub/actions".Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar), "main"); string file = Path.Combine(directory, Constants.Path.ActionManifestYamlFile); Directory.CreateDirectory(Path.GetDirectoryName(file)); File.WriteAllText(file, Content); @@ -2908,7 +2908,7 @@ runs: Reference = new Pipelines.RepositoryPathReference() { Name = "GitHub/actions", - Ref = "master", + Ref = "main", RepositoryType = Pipelines.RepositoryTypes.GitHub } }; @@ -3453,7 +3453,7 @@ runs: private void CreateAction(string yamlContent, out Pipelines.ActionStep instance, out string directory) { - directory = Path.Combine(_workFolder, Constants.Path.ActionsDirectory, "GitHub/actions".Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar), "master"); + directory = Path.Combine(_workFolder, Constants.Path.ActionsDirectory, "GitHub/actions".Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar), "main"); string file = Path.Combine(directory, Constants.Path.ActionManifestYmlFile); Directory.CreateDirectory(Path.GetDirectoryName(file)); File.WriteAllText(file, yamlContent); @@ -3463,7 +3463,7 @@ runs: Reference = new Pipelines.RepositoryPathReference() { Name = "GitHub/actions", - Ref = "master", + Ref = "main", RepositoryType = Pipelines.RepositoryTypes.GitHub } }; @@ -3481,7 +3481,7 @@ runs: Reference = new Pipelines.RepositoryPathReference() { Name = "GitHub/actions", - Ref = "master", + Ref = "main", RepositoryType = Pipelines.PipelineConstants.SelfAlias } }; diff --git a/src/Test/L0/Worker/ActionManifestManagerL0.cs b/src/Test/L0/Worker/ActionManifestManagerL0.cs index 737341922..0f89f743c 100644 --- a/src/Test/L0/Worker/ActionManifestManagerL0.cs +++ b/src/Test/L0/Worker/ActionManifestManagerL0.cs @@ -717,7 +717,7 @@ namespace GitHub.Runner.Common.Tests.Worker _ec.Object.ExpressionValues["github"] = new DictionaryContextData { - { "ref", new StringContextData("refs/heads/master") }, + { "ref", new StringContextData("refs/heads/main") }, }; _ec.Object.ExpressionValues["strategy"] = new DictionaryContextData(); _ec.Object.ExpressionValues["matrix"] = new DictionaryContextData(); @@ -737,7 +737,7 @@ namespace GitHub.Runner.Common.Tests.Worker result = actionManifest.EvaluateDefaultInput(_ec.Object, "testInput", new BasicExpressionToken(null, null, null, "github.ref")); //Assert - Assert.Equal("refs/heads/master", result); + Assert.Equal("refs/heads/main", result); } finally {