From 27de41d10e92972207558920aa792f8e2a01a765 Mon Sep 17 00:00:00 2001 From: Christo du Toit Date: Fri, 6 Sep 2024 19:38:00 +0100 Subject: [PATCH 1/3] MINOR FIX: Label job should only apply to pull requests. push requests do not have access to all the info in that context. --- .../Models/Pipelines/GithubPipelines/DotNets/LabelJob.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/LabelJob.cs b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/LabelJob.cs index 6040eb4..85569cf 100644 --- a/ADotNet/Models/Pipelines/GithubPipelines/DotNets/LabelJob.cs +++ b/ADotNet/Models/Pipelines/GithubPipelines/DotNets/LabelJob.cs @@ -62,6 +62,13 @@ public LabelJob( 'BUSINESS:' ]; +const pullRequest = context.payload.pull_request; + +if (!pullRequest) { + console.log('No pull request context available.'); + return; +} + const title = context.payload.pull_request.title; const existingLabels = context.payload.pull_request.labels.map(label => label.name); From 2972b6816eb06f9608171ec4cbe66a0d47cb4d2f Mon Sep 17 00:00:00 2001 From: Christo du Toit Date: Fri, 6 Sep 2024 19:40:36 +0100 Subject: [PATCH 2/3] CODE RUB: Updated build script --- .github/workflows/build.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29b5a1f..41a2df7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -70,6 +70,15 @@ jobs: ]; + const pullRequest = context.payload.pull_request; + + + if (!pullRequest) { + console.log('No pull request context available.'); + return; + } + + const title = context.payload.pull_request.title; const existingLabels = context.payload.pull_request.labels.map(label => label.name); From 657144816f072f98d25d3047609751aa4a8e9827 Mon Sep 17 00:00:00 2001 From: Christo du Toit Date: Fri, 6 Sep 2024 19:46:45 +0100 Subject: [PATCH 3/3] RELEASES: 3.0.4 --- ADotNet/ADotNet.csproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ADotNet/ADotNet.csproj b/ADotNet/ADotNet.csproj index dfb7a36..496fb8b 100644 --- a/ADotNet/ADotNet.csproj +++ b/ADotNet/ADotNet.csproj @@ -14,13 +14,13 @@ git ADO YAML AzureDevOps - This release has a new label job component that can be used to automatically label pull requests based on the pull request title. + This release has a minor fix for the label job component. The label job component now only applies to pull requests. True README.md - 3.0.3 - 3.0.3 - 3.0.3 + 3.0.4 + 3.0.4 + 3.0.4 License.txt True https://github.com/hassanhabib/ADotNet