diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3f5ffc4d..97d86b0e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,7 +50,7 @@ jobs: run: git fetch --prune --unshallow # codecov and unittests need 2.1, gitversion needs 5.0 - - uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 + - uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0 with: dotnet-version: | 2.1 @@ -61,13 +61,13 @@ jobs: 8.0 - name: Cache Tools - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4 with: path: tools key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} - name: Build project - uses: cake-build/cake-action@a6eb054329257c9e70a6c6bf01747ad6e1d9d52b # v1.4.1 + uses: cake-build/cake-action@1223b6fa067ad192159f43b50cd4f953679b0934 # v2.0.0 with: script-path: recipe.cake target: CI @@ -76,7 +76,7 @@ jobs: # currently, Cake.Recipe does not upload artifacts when run on gh-actions - name: Upload Issues - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4 with: if-no-files-found: warn name: ${{ matrix.os }} Issues @@ -85,7 +85,7 @@ jobs: BuildArtifacts/**/coverlet/*.xml - name: Upload Packages - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 + uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4 if: runner.os == 'Windows' with: if-no-files-found: warn diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 6b4ef91b..84a1263f 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -24,7 +24,7 @@ jobs: with: fetch-depth: 0 - - uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 + - uses: actions/setup-dotnet@4d6c8fcf3c8f7a60068d26b594648e99df24cee3 # v4.0.0 with: dotnet-version: | 2.1 @@ -35,22 +35,22 @@ jobs: 8.0 - name: Cache Tools - uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 + uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4 with: path: tools key: ${{ runner.os }}-tools-${{ hashFiles('recipe.cake') }} - name: Initialize CodeQL - uses: github/codeql-action/init@407ffafae6a767df3e0230c3df91b6443ae8df75 # v2 + uses: github/codeql-action/init@379614612a29c9e28f31f39a59013eb8012a51f0 # v3 with: languages: ${{ matrix.language }} - name: Build project - uses: cake-build/cake-action@a6eb054329257c9e70a6c6bf01747ad6e1d9d52b # v1.4.1 + uses: cake-build/cake-action@1223b6fa067ad192159f43b50cd4f953679b0934 # v2.0.0 with: script-path: recipe.cake target: DotNetCore-Build cake-version: 1.3.0 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@407ffafae6a767df3e0230c3df91b6443ae8df75 # v2 + uses: github/codeql-action/analyze@379614612a29c9e28f31f39a59013eb8012a51f0 # v3 diff --git a/global.json b/global.json index 7d3b56c9..ad8ad01d 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.100", + "version": "8.0.201", "rollForward": "latestFeature" } } \ No newline at end of file diff --git a/src/Cake.GitLabCI.Module/AnsiEscapeCodes.cs b/src/Cake.GitLabCI.Module/AnsiEscapeCodes.cs index db030c7d..14e975e9 100644 --- a/src/Cake.GitLabCI.Module/AnsiEscapeCodes.cs +++ b/src/Cake.GitLabCI.Module/AnsiEscapeCodes.cs @@ -1,4 +1,4 @@ -namespace Cake.AzurePipelines.Module +namespace Cake.GitLabCI.Module { internal static class AnsiEscapeCodes { diff --git a/src/Cake.GitLabCI.Module/GitLabCILog.cs b/src/Cake.GitLabCI.Module/GitLabCILog.cs index 32af678c..bf69f299 100644 --- a/src/Cake.GitLabCI.Module/GitLabCILog.cs +++ b/src/Cake.GitLabCI.Module/GitLabCILog.cs @@ -6,7 +6,7 @@ using JetBrains.Annotations; -namespace Cake.AzurePipelines.Module +namespace Cake.GitLabCI.Module { /// /// implementation for GitLab CI. @@ -70,13 +70,16 @@ public void Write(Verbosity verbosity, LogLevel level, string format, params obj message = $"{level}: {string.Format(format, args)}"; } + // Passing a string to IConsole.WriteLine() / IConsole.WriteErrorLine() will cause that string to be interpreted as format string. + // This will cause an error if the string contains curly braces and WriteLine() will faile with a FormatException. + // To avoid this, pass in the "no-op" format string and pass the text to write to the console as argument that will be formatted into the format string if (level > LogLevel.Error) { - _console.WriteLine(message); + _console.WriteLine("{0}", message); } else { - _console.WriteErrorLine(message); + _console.WriteErrorLine("{0}", message); } } } diff --git a/src/Cake.GitLabCI.Module/GitLabCIModule.Obsolete.cs b/src/Cake.GitLabCI.Module/GitLabCIModule.Obsolete.cs new file mode 100644 index 00000000..2c8425c3 --- /dev/null +++ b/src/Cake.GitLabCI.Module/GitLabCIModule.Obsolete.cs @@ -0,0 +1,20 @@ +using System; + +using Cake.Core.Composition; + +namespace Cake.AzurePipelines.Module +{ + /// + /// Legacy implementation for GitLab CI. + /// + /// + /// When was introduced initially, it was placed in the Cake.AzurePipelines.Module namespace by accident. + /// + /// The namespace has since been adjusted, but this class is still provided in the Cake.AzurePipelines.Module namespace for backwards compatibility in Cake.Frosting projects. + /// When possible, use instead. + /// + /// + [Obsolete($"Use {nameof(GitLabCIModule)} from namespace Cake.GitLabCI.Module instead")] + public class GitLabCIModule : GitLabCI.Module.GitLabCIModule + { } +} diff --git a/src/Cake.GitLabCI.Module/GitLabCIModule.cs b/src/Cake.GitLabCI.Module/GitLabCIModule.cs index b3de95e3..6f78824c 100644 --- a/src/Cake.GitLabCI.Module/GitLabCIModule.cs +++ b/src/Cake.GitLabCI.Module/GitLabCIModule.cs @@ -4,9 +4,9 @@ using Cake.Core.Composition; using Cake.Core.Diagnostics; -[assembly: CakeModule(typeof(Cake.AzurePipelines.Module.GitLabCIModule))] +[assembly: CakeModule(typeof(Cake.GitLabCI.Module.GitLabCIModule))] -namespace Cake.AzurePipelines.Module +namespace Cake.GitLabCI.Module { /// /// implementation for GitLab CI.