From 6f4373db29564785e0cefd3cbeb055e12f61fe15 Mon Sep 17 00:00:00 2001 From: James Ruskin Date: Mon, 23 Sep 2024 10:45:07 +0100 Subject: [PATCH] (build) Fixes Missing Function Call in Start-C4bJenkins Also ensures we're grabbing the latest version from the PR? --- .github/workflows/test.yml | 4 ++++ Start-C4bJenkinsSetup.ps1 | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7423d01..d286eaf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -87,6 +87,8 @@ jobs: steps: - name: Check out code uses: actions/checkout@v4 + with: + ref: "refs/pull/${{ github.event.number }}/merge" - name: Create License File run: | @@ -141,6 +143,8 @@ jobs: steps: - name: Check out code uses: actions/checkout@v4 + with: + ref: "refs/pull/${{ github.event.number }}/merge" - name: Login to Azure uses: azure/login@v2 diff --git a/Start-C4bJenkinsSetup.ps1 b/Start-C4bJenkinsSetup.ps1 index 76cf5eb..f643827 100644 --- a/Start-C4bJenkinsSetup.ps1 +++ b/Start-C4bJenkinsSetup.ps1 @@ -14,7 +14,10 @@ param( [string]$HostName = $env:ComputerName, # API key of your Nexus repo, for Chocolatey Jenkins jobs to use - [string]$NuGetApiKey = $(Get-ChocoEnvironmentProperty NuGetApiKey -AsPlainText) + [string]$NuGetApiKey = $( + if (-not (Get-Command Get-ChocoEnvironmentProperty -ErrorAction SilentlyContinue)) {. $PSScriptRoot\scripts\Get-Helpers.ps1} + Get-ChocoEnvironmentProperty NuGetApiKey -AsPlainText + ) ) process { $DefaultEap = $ErrorActionPreference