From faff23ca0ce65b28fdae1c98c339b5925ca17de4 Mon Sep 17 00:00:00 2001 From: Christo du Toit Date: Tue, 21 May 2024 22:33:51 +0100 Subject: [PATCH] CODE RUB: Updated the build script --- .github/workflows/{dotnet.yml => build.yml} | 8 +++++++- ADotNet.Infrastructure.Build/Program.cs | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) rename .github/workflows/{dotnet.yml => build.yml} (99%) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/build.yml similarity index 99% rename from .github/workflows/dotnet.yml rename to .github/workflows/build.yml index 6c3cd3d..29b5a1f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: .Net +name: Build on: push: branches: @@ -35,6 +35,7 @@ jobs: with: github-token: ${{ secrets.PAT_FOR_TAGGING }} script: >2+ + const prefixes = [ 'INFRA:', 'PROVISIONS:', @@ -67,8 +68,13 @@ jobs: 'DESIGN:', 'BUSINESS:' ]; + + const title = context.payload.pull_request.title; + const existingLabels = context.payload.pull_request.labels.map(label => label.name); + + for (const prefix of prefixes) { if (title.startsWith(prefix)) { const label = prefix.slice(0, -1); diff --git a/ADotNet.Infrastructure.Build/Program.cs b/ADotNet.Infrastructure.Build/Program.cs index 6e169fc..e8da9a5 100644 --- a/ADotNet.Infrastructure.Build/Program.cs +++ b/ADotNet.Infrastructure.Build/Program.cs @@ -22,7 +22,7 @@ static void Main(string[] args) var githubPipeline = new GithubPipeline { - Name = ".Net", + Name = "Build", OnEvents = new Events { @@ -110,7 +110,7 @@ static void Main(string[] args) } }; - string buildScriptPath = "../../../../.github/workflows/dotnet.yml"; + string buildScriptPath = "../../../../.github/workflows/build.yml"; string directoryPath = Path.GetDirectoryName(buildScriptPath); if (!Directory.Exists(directoryPath))