From e5ab44c0872c0840491e198b3e253c9490887209 Mon Sep 17 00:00:00 2001 From: Freddy Kristiansen Date: Sat, 30 Sep 2023 09:08:55 +0200 Subject: [PATCH] Bug fix for using self-hosted runners while having an Azure KeyVault connection (#745) Check that C:\Modules (exists on GitHub hosted windows runners) exists before enumerating it. Co-authored-by: freddydk --- Actions/ReadSecrets/ReadSecretsHelper.psm1 | 2 +- RELEASENOTES.md | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Actions/ReadSecrets/ReadSecretsHelper.psm1 b/Actions/ReadSecrets/ReadSecretsHelper.psm1 index 2dc9dec07..f7b5e887c 100644 --- a/Actions/ReadSecrets/ReadSecretsHelper.psm1 +++ b/Actions/ReadSecrets/ReadSecretsHelper.psm1 @@ -109,7 +109,7 @@ function GetKeyVaultCredentials { } function InstallKeyVaultModuleIfNeeded { - if ($isWindows) { + if ($isWindows -and (Test-Path 'C:\Modules\az_*')) { $azModulesPath = Get-ChildItem 'C:\Modules\az_*' | Where-Object { $_.PSIsContainer } if ($azModulesPath) { Write-Host $azModulesPath.FullName diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 88f66b24c..fae66872b 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -10,6 +10,7 @@ AL-Go for GitHub allows you to build and test using insider builds without any e ### Issues - Issue 730 Support for external rulesets. +- Using self-hosted runners while using Azure KeyVault for secrets or signing might fail with C:\Modules doesn't exist ### New Settings - `enableExternalRulesets`: set this setting to true if you want to allow AL-Go to automatically download external references in rulesets.