From 7f74f7a91b81f292adb130a9397c808ffb75f738 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Sat, 14 Jan 2023 10:26:19 +0100 Subject: [PATCH 1/4] Declare few more files as `DocumentationChanges` --- Build/Build.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Build/Build.cs b/Build/Build.cs index de0c09f41a..087c9b6d50 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -349,7 +349,12 @@ from framework in supportedFrameworks }); bool HasDocumentationChanges => - Changes.Any(x => x.StartsWith("docs")); + Changes.Any(x => + x.StartsWith("docs") || + x.StartsWith("CONTRIBUTING.md") || + x.StartsWith("cSpell.json") || + x.StartsWith("LICENSE") || + x.StartsWith("README.md")); bool HasSourceChanges => Changes.Any(x => !x.StartsWith("docs")); From 63774ed6ae9376b73a46873899a0c3e8f2c74604 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Sat, 14 Jan 2023 13:35:42 +0100 Subject: [PATCH 2/4] Make sure, that `HasSourceChanges` is the opposite of `HasDocumentationChanges` --- Build/Build.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Build/Build.cs b/Build/Build.cs index 087c9b6d50..512da21bdd 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -348,16 +348,16 @@ from framework in supportedFrameworks customLogger: (_, msg) => Error(msg)); }); - bool HasDocumentationChanges => - Changes.Any(x => - x.StartsWith("docs") || - x.StartsWith("CONTRIBUTING.md") || - x.StartsWith("cSpell.json") || - x.StartsWith("LICENSE") || - x.StartsWith("README.md")); - - bool HasSourceChanges => - Changes.Any(x => !x.StartsWith("docs")); + bool HasDocumentationChanges => Changes.Any(x => IsDocumentation(x)); + + bool HasSourceChanges => Changes.Any(x => !IsDocumentation(x)); + + static bool IsDocumentation(string x) => + x.StartsWith("docs") || + x.StartsWith("CONTRIBUTING.md") || + x.StartsWith("cSpell.json") || + x.StartsWith("LICENSE") || + x.StartsWith("README.md"); string[] Changes => Repository.Diff From 6931554117d191ce8867a93b6e38c373df25d15d Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Thu, 2 Feb 2023 19:19:05 +0100 Subject: [PATCH 3/4] Force complete build pipeline when modifying the build itself --- Build/Build.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build/Build.cs b/Build/Build.cs index 512da21bdd..3a089c56bc 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -370,7 +370,7 @@ static bool IsDocumentation(string x) => Tree TargetBranch => Repository.Branches[PullRequestBase].Tip.Tree; Tree SourceBranch => Repository.Branches[Repository.Head.FriendlyName].Tip.Tree; - bool RunAllTargets => string.IsNullOrWhiteSpace(PullRequestBase); + bool RunAllTargets => string.IsNullOrWhiteSpace(PullRequestBase) || Changes.Any(x => x.StartsWith("Build")); bool IsTag => BranchSpec != null && BranchSpec.Contains("refs/tags", StringComparison.InvariantCultureIgnoreCase); } From 98f6d6654f0b3daf23e51e9e56cf4d724c51edc5 Mon Sep 17 00:00:00 2001 From: Lukas Gasselsberger Date: Thu, 2 Feb 2023 19:29:14 +0100 Subject: [PATCH 4/4] Consider also `package.json` as documentation --- Build/Build.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Build/Build.cs b/Build/Build.cs index 3a089c56bc..7d2b7631e5 100644 --- a/Build/Build.cs +++ b/Build/Build.cs @@ -357,6 +357,7 @@ static bool IsDocumentation(string x) => x.StartsWith("CONTRIBUTING.md") || x.StartsWith("cSpell.json") || x.StartsWith("LICENSE") || + x.StartsWith("package.json") || x.StartsWith("README.md"); string[] Changes =>