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/2] 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/2] 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);