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); 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);