From ee9c258a1483d914bbd98f9a86a42c2bdb0b54a4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 17 Jul 2025 17:05:12 +0000 Subject: [PATCH 01/11] Initial plan From 9fb13f6facb9f092f4b60b54b92a7711bd37854f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 17 Jul 2025 17:11:40 +0000 Subject: [PATCH 02/11] Add KeyVaultKeyReference support for GitHub App authentication Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com> --- README.md | 33 +++++++++++++++++++++++++++++++-- action.yml | 4 ++++ scripts/init.ps1 | 36 ++++++++++++++++++++++++++++-------- 3 files changed, 63 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 28d87ad..d1adf3c 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ To get started with your own GitHub PowerShell based action, [create a new repos | `Token` | Log in using an Installation Access Token (IAT). | false | `${{ github.token }}` | | `ClientID` | Log in using a GitHub App, with the App's Client ID and Private Key. | false | | | `PrivateKey` | Log in using a GitHub App, with the App's Client ID and Private Key. | false | | +| `KeyVaultKeyReference` | Log in using a GitHub App, with the App's Client ID and KeyVault Key Reference. | false | | | `Debug` | Enable debug output for the whole action. | false | `'false'` | | `Verbose` | Enable verbose output for the whole action. | false | `'false'` | | `Version` | Specifies the exact version of the GitHub module to install. | false | | @@ -176,7 +177,35 @@ jobs: } ``` -#### Example 5: Using outputs from the script +#### Example 5: Run a GitHub PowerShell script with a GitHub App using a Client ID and KeyVault Key Reference + +Runs a script that uses the GitHub PowerShell module with a GitHub App authenticated via Azure KeyVault. This example retrieves the GitHub App details. + +> [!NOTE] +> This authentication method requires the `azure/login` action to authenticate with Azure first. The KeyVault Key Reference should be a URL pointing to the private key stored in Azure KeyVault. + +```yaml +jobs: + Run-Script: + runs-on: ubuntu-latest + steps: + - name: Login to Azure + uses: azure/login@v1 + with: + creds: ${{ secrets.AZURE_CREDENTIALS }} + + - name: Run script + uses: PSModule/GitHub-Script@v1 + with: + ClientID: ${{ secrets.CLIENT_ID }} + KeyVaultKeyReference: ${{ secrets.KEYVAULT_KEY_REFERENCE }} + Script: | + LogGroup "Get-GitHubApp" { + Get-GitHubApp + } +``` + +#### Example 6: Using outputs from the script Runs a script that uses the GitHub PowerShell module and outputs the result. @@ -201,7 +230,7 @@ Runs a script that uses the GitHub PowerShell module and outputs the result. Write-GitHubNotice -Message $result.Zen -Title 'GitHub Zen' ``` -#### Example 6: Run a script with credential cleanup +#### Example 7: Run a script with credential cleanup Runs a script with `PreserveCredentials` set to `false` to automatically disconnect GitHub credentials after execution. diff --git a/action.yml b/action.yml index eb5fa1f..a4614ec 100644 --- a/action.yml +++ b/action.yml @@ -23,6 +23,9 @@ inputs: PrivateKey: description: Log in using a GitHub App, using the App's Client ID and Private Key. required: false + KeyVaultKeyReference: + description: Log in using a GitHub App, using the App's Client ID and KeyVault Key Reference. + required: false Debug: description: Enable debug output for the whole action. required: false @@ -80,6 +83,7 @@ runs: PSMODULE_GITHUB_SCRIPT_INPUT_Token: ${{ inputs.Token }} PSMODULE_GITHUB_SCRIPT_INPUT_ClientID: ${{ inputs.ClientID }} PSMODULE_GITHUB_SCRIPT_INPUT_PrivateKey: ${{ inputs.PrivateKey }} + PSMODULE_GITHUB_SCRIPT_INPUT_KeyVaultKeyReference: ${{ inputs.KeyVaultKeyReference }} PSMODULE_GITHUB_SCRIPT_INPUT_Debug: ${{ inputs.Debug }} PSMODULE_GITHUB_SCRIPT_INPUT_Verbose: ${{ inputs.Verbose }} PSMODULE_GITHUB_SCRIPT_INPUT_Version: ${{ inputs.Version }} diff --git a/scripts/init.ps1 b/scripts/init.ps1 index 2cd7566..802bd1d 100644 --- a/scripts/init.ps1 +++ b/scripts/init.ps1 @@ -78,15 +78,28 @@ process { $providedToken = -not [string]::IsNullOrEmpty($env:PSMODULE_GITHUB_SCRIPT_INPUT_Token) $providedClientID = -not [string]::IsNullOrEmpty($env:PSMODULE_GITHUB_SCRIPT_INPUT_ClientID) $providedPrivateKey = -not [string]::IsNullOrEmpty($env:PSMODULE_GITHUB_SCRIPT_INPUT_PrivateKey) + $providedKeyVaultKeyReference = -not [string]::IsNullOrEmpty($env:PSMODULE_GITHUB_SCRIPT_INPUT_KeyVaultKeyReference) + + # Validate mutual exclusion of PrivateKey and KeyVaultKeyReference + if ($providedPrivateKey -and $providedKeyVaultKeyReference) { + throw 'Only one of PrivateKey or KeyVaultKeyReference can be provided.' + } + + # Validate that if ClientID is provided, exactly one of PrivateKey or KeyVaultKeyReference is also provided + if ($providedClientID -and -not ($providedPrivateKey -or $providedKeyVaultKeyReference)) { + throw 'When ClientID is provided, either PrivateKey or KeyVaultKeyReference must also be provided.' + } + $moduleStatus = [pscustomobject]@{ - Name = $Name - Version = [string]::IsNullOrEmpty($Version) ? 'latest' : $Version - Prerelease = $Prerelease - 'Already installed' = $null -ne $alreadyInstalled - 'Already imported' = $null -ne $alreadyImported - 'Provided Token' = $providedToken - 'Provided ClientID' = $providedClientID - 'Provided PrivateKey' = $providedPrivateKey + Name = $Name + Version = [string]::IsNullOrEmpty($Version) ? 'latest' : $Version + Prerelease = $Prerelease + 'Already installed' = $null -ne $alreadyInstalled + 'Already imported' = $null -ne $alreadyImported + 'Provided Token' = $providedToken + 'Provided ClientID' = $providedClientID + 'Provided PrivateKey' = $providedPrivateKey + 'Provided KeyVaultKeyReference' = $providedKeyVaultKeyReference } if ($showInit) { Write-Output 'Module status:' @@ -101,6 +114,13 @@ process { Silent = (-not $showInit) } Connect-GitHub @params + } elseif ($providedClientID -and $providedKeyVaultKeyReference) { + $params = @{ + ClientID = $env:PSMODULE_GITHUB_SCRIPT_INPUT_ClientID + KeyVaultKeyReference = $env:PSMODULE_GITHUB_SCRIPT_INPUT_KeyVaultKeyReference + Silent = (-not $showInit) + } + Connect-GitHub @params } elseif ($providedToken) { $params = @{ Token = $env:PSMODULE_GITHUB_SCRIPT_INPUT_Token From ece9e5396c07f7a24a103f8b3bff545ba17d6f6c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 17 Jul 2025 17:34:33 +0000 Subject: [PATCH 03/11] Add KeyVaultKeyReference authentication test Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com> --- .github/workflows/TestWorkflow.yml | 56 ++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index a0efac8..22ca353 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -37,6 +37,18 @@ on: TEST_APP_ORG_PRIVATE_KEY: description: Private Key for the test GitHub App for the organization required: true + AZURE_CLIENT_ID: + description: Azure Client ID for KeyVault authentication + required: true + AZURE_TENANT_ID: + description: Azure Tenant ID for KeyVault authentication + required: true + AZURE_SUBSCRIPTION_ID: + description: Azure Subscription ID for KeyVault authentication + required: true + KEYVAULT_KEY_REFERENCE: + description: Azure KeyVault key reference URL for GitHub App authentication + required: true permissions: contents: read @@ -542,6 +554,50 @@ jobs: Get-GitHubConfig | Format-List | Out-String } + ActionTestWithKeyVaultKeyReference: + name: WithKeyVaultKeyReference + runs-on: ${{ inputs.runs-on }} + steps: + # Need to check out as part of the test, as its a local action + - name: Checkout repo + uses: actions/checkout@v4 + + # Login to Azure to enable KeyVault access + - name: Login to Azure + uses: azure/login@v1 + with: + client-id: ${{ secrets.AZURE_CLIENT_ID }} + tenant-id: ${{ secrets.AZURE_TENANT_ID }} + subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + allow-no-subscriptions: true + + - name: Action-Test + uses: ./ + with: + ClientID: ${{ secrets.AZURE_CLIENT_ID }} + KeyVaultKeyReference: ${{ secrets.KEYVAULT_KEY_REFERENCE }} + Prerelease: ${{ inputs.Prerelease }} + Script: | + LogGroup 'Get-GitHubApp' { + Get-GitHubApp | Format-List | Out-String + } + + LogGroup 'Get-GitHubAppInstallation' { + Get-GitHubAppInstallation | Format-Table -AutoSize | Out-String + } + + LogGroup 'Connect to all installations of the app' { + Connect-GitHubApp + } + + LogGroup 'Contexts' { + Get-GitHubContext -ListAvailable | Format-Table -AutoSize | Out-String + } + + LogGroup 'GitHubConfig' { + Get-GitHubConfig | Format-List | Out-String + } + ActionTestPreserveCredentialsFalse: name: PreserveCredentials False runs-on: ${{ inputs.runs-on }} From b256dc31b2572373e9f31bad82d4990253511a46 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 17 Jul 2025 18:11:25 +0000 Subject: [PATCH 04/11] Update azure/login action to v2 Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com> --- .github/workflows/TestWorkflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index 22ca353..05ba9be 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -564,7 +564,7 @@ jobs: # Login to Azure to enable KeyVault access - name: Login to Azure - uses: azure/login@v1 + uses: azure/login@v2 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} tenant-id: ${{ secrets.AZURE_TENANT_ID }} From a8709239573d430e020f98f226d6439c068e9008 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 18 Jul 2025 07:07:00 +0000 Subject: [PATCH 05/11] Add azure environment to KeyVaultKeyReference test job Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com> --- .github/workflows/TestWorkflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index 05ba9be..cc4fa71 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -556,6 +556,7 @@ jobs: ActionTestWithKeyVaultKeyReference: name: WithKeyVaultKeyReference + environment: azure runs-on: ${{ inputs.runs-on }} steps: # Need to check out as part of the test, as its a local action From 3e74941ee6c200466926207f91918f4a14d7fd1b Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 18 Jul 2025 09:10:25 +0200 Subject: [PATCH 06/11] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Remove=20Azure?= =?UTF-8?q?=20authentication=20secrets=20and=20switch=20to=20using=20varia?= =?UTF-8?q?bles=20in=20KeyVaultKeyReference=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/TestWorkflow.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index cc4fa71..a4e72fa 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -37,15 +37,6 @@ on: TEST_APP_ORG_PRIVATE_KEY: description: Private Key for the test GitHub App for the organization required: true - AZURE_CLIENT_ID: - description: Azure Client ID for KeyVault authentication - required: true - AZURE_TENANT_ID: - description: Azure Tenant ID for KeyVault authentication - required: true - AZURE_SUBSCRIPTION_ID: - description: Azure Subscription ID for KeyVault authentication - required: true KEYVAULT_KEY_REFERENCE: description: Azure KeyVault key reference URL for GitHub App authentication required: true @@ -567,15 +558,15 @@ jobs: - name: Login to Azure uses: azure/login@v2 with: - client-id: ${{ secrets.AZURE_CLIENT_ID }} - tenant-id: ${{ secrets.AZURE_TENANT_ID }} - subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} + client-id: ${{ vars.AZURE_CLIENT_ID }} + tenant-id: ${{ vars.AZURE_TENANT_ID }} + subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} allow-no-subscriptions: true - name: Action-Test uses: ./ with: - ClientID: ${{ secrets.AZURE_CLIENT_ID }} + ClientID: ${{ secrets.TEST_APP_ORG_CLIENT_ID }} KeyVaultKeyReference: ${{ secrets.KEYVAULT_KEY_REFERENCE }} Prerelease: ${{ inputs.Prerelease }} Script: | From 667a7ff3dea5f8cfe2a33119e799a89a2509124d Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 18 Jul 2025 09:11:23 +0200 Subject: [PATCH 07/11] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Ensure=20id-tok?= =?UTF-8?q?en=20permission=20is=20set=20for=20Action-Test=20and=20TestWork?= =?UTF-8?q?flow=20jobs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/Action-Test-Prerelease.yml | 1 + .github/workflows/Action-Test.yml | 1 + .github/workflows/TestWorkflow.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/Action-Test-Prerelease.yml b/.github/workflows/Action-Test-Prerelease.yml index eb1c725..89122f0 100644 --- a/.github/workflows/Action-Test-Prerelease.yml +++ b/.github/workflows/Action-Test-Prerelease.yml @@ -12,6 +12,7 @@ concurrency: permissions: contents: read pull-requests: read + id-token: write jobs: ActionTest: diff --git a/.github/workflows/Action-Test.yml b/.github/workflows/Action-Test.yml index 77b6918..7aaed5b 100644 --- a/.github/workflows/Action-Test.yml +++ b/.github/workflows/Action-Test.yml @@ -15,6 +15,7 @@ concurrency: permissions: contents: read pull-requests: read + id-token: write jobs: ActionTest: diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index a4e72fa..7e581cb 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -44,6 +44,7 @@ on: permissions: contents: read pull-requests: read + id-token: write jobs: ActionTestBasic: From ac9a2e22943ae73b41a84948ac9b42c0a711bc4c Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 18 Jul 2025 09:23:55 +0200 Subject: [PATCH 08/11] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Add=20logging?= =?UTF-8?q?=20for=20GitHub=20context=20details=20in=20WithKeyVaultKeyRefer?= =?UTF-8?q?ence=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/TestWorkflow.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index 7e581cb..12a5fa8 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -571,6 +571,10 @@ jobs: KeyVaultKeyReference: ${{ secrets.KEYVAULT_KEY_REFERENCE }} Prerelease: ${{ inputs.Prerelease }} Script: | + LogGroup 'Context details' { + Get-GitHubContext | Select-Object * | Format-Table -AutoSize | Out-String + } + LogGroup 'Get-GitHubApp' { Get-GitHubApp | Format-List | Out-String } From 6078232768658cb3c247322abd4e6afee036e6f1 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 18 Jul 2025 09:27:47 +0200 Subject: [PATCH 09/11] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Simplify=20logg?= =?UTF-8?q?ing=20of=20GitHub=20context=20details=20in=20WithKeyVaultKeyRef?= =?UTF-8?q?erence=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/TestWorkflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index 12a5fa8..f8d84f7 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -572,7 +572,7 @@ jobs: Prerelease: ${{ inputs.Prerelease }} Script: | LogGroup 'Context details' { - Get-GitHubContext | Select-Object * | Format-Table -AutoSize | Out-String + Get-GitHubContext | Select-Object * | Out-String } LogGroup 'Get-GitHubApp' { From a336a08ee666ad2df0b40146d95c1bd8170ee793 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 18 Jul 2025 10:10:56 +0200 Subject: [PATCH 10/11] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Enhance=20loggi?= =?UTF-8?q?ng=20and=20Azure=20KeyVault=20integration=20in=20WithKeyVaultKe?= =?UTF-8?q?yReference=20jobs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/TestWorkflow.yml | 51 +++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/.github/workflows/TestWorkflow.yml b/.github/workflows/TestWorkflow.yml index f8d84f7..579c6cc 100644 --- a/.github/workflows/TestWorkflow.yml +++ b/.github/workflows/TestWorkflow.yml @@ -568,7 +568,56 @@ jobs: uses: ./ with: ClientID: ${{ secrets.TEST_APP_ORG_CLIENT_ID }} - KeyVaultKeyReference: ${{ secrets.KEYVAULT_KEY_REFERENCE }} + KeyVaultKeyReference: 'https://psmodule-test-vault.vault.azure.net/keys/psmodule-org-app/569ae34250e64adca6a2b2d159d454a5' + Prerelease: ${{ inputs.Prerelease }} + Script: | + LogGroup 'Context details' { + Get-GitHubContext | Select-Object * | Out-String + } + + LogGroup 'Get-GitHubApp' { + Get-GitHubApp | Format-List | Out-String + } + + LogGroup 'Get-GitHubAppInstallation' { + Get-GitHubAppInstallation | Format-Table -AutoSize | Out-String + } + + LogGroup 'Connect to all installations of the app' { + Connect-GitHubApp + } + + LogGroup 'Contexts' { + Get-GitHubContext -ListAvailable | Format-Table -AutoSize | Out-String + } + + LogGroup 'GitHubConfig' { + Get-GitHubConfig | Format-List | Out-String + } + + ActionTestWithKeyVaultKeyReferenceLatest: + name: WithKeyVaultKeyReferenceLatest + environment: azure + runs-on: ${{ inputs.runs-on }} + steps: + # Need to check out as part of the test, as its a local action + - name: Checkout repo + uses: actions/checkout@v4 + + # Login to Azure to enable KeyVault access + - name: Login to Azure + uses: azure/login@v2 + with: + client-id: ${{ vars.AZURE_CLIENT_ID }} + tenant-id: ${{ vars.AZURE_TENANT_ID }} + subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} + allow-no-subscriptions: true + + - name: Action-Test + uses: ./ + with: + ClientID: ${{ secrets.TEST_APP_ORG_CLIENT_ID }} + KeyVaultKeyReference: 'https://psmodule-test-vault.vault.azure.net/keys/psmodule-org-app/' Prerelease: ${{ inputs.Prerelease }} Script: | LogGroup 'Context details' { From 4498090914fc0f74c3e4862daec335af9bad46f7 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 19 Jul 2025 01:50:55 +0200 Subject: [PATCH 11/11] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Refactor=20vali?= =?UTF-8?q?dation=20logic=20for=20KeyVaultKeyReference=20and=20PrivateKey?= =?UTF-8?q?=20in=20init.ps1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/init.ps1 | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/init.ps1 b/scripts/init.ps1 index 802bd1d..76663fd 100644 --- a/scripts/init.ps1 +++ b/scripts/init.ps1 @@ -79,26 +79,26 @@ process { $providedClientID = -not [string]::IsNullOrEmpty($env:PSMODULE_GITHUB_SCRIPT_INPUT_ClientID) $providedPrivateKey = -not [string]::IsNullOrEmpty($env:PSMODULE_GITHUB_SCRIPT_INPUT_PrivateKey) $providedKeyVaultKeyReference = -not [string]::IsNullOrEmpty($env:PSMODULE_GITHUB_SCRIPT_INPUT_KeyVaultKeyReference) - + # Validate mutual exclusion of PrivateKey and KeyVaultKeyReference if ($providedPrivateKey -and $providedKeyVaultKeyReference) { throw 'Only one of PrivateKey or KeyVaultKeyReference can be provided.' } - + # Validate that if ClientID is provided, exactly one of PrivateKey or KeyVaultKeyReference is also provided if ($providedClientID -and -not ($providedPrivateKey -or $providedKeyVaultKeyReference)) { throw 'When ClientID is provided, either PrivateKey or KeyVaultKeyReference must also be provided.' } - + $moduleStatus = [pscustomobject]@{ - Name = $Name - Version = [string]::IsNullOrEmpty($Version) ? 'latest' : $Version - Prerelease = $Prerelease - 'Already installed' = $null -ne $alreadyInstalled - 'Already imported' = $null -ne $alreadyImported - 'Provided Token' = $providedToken - 'Provided ClientID' = $providedClientID - 'Provided PrivateKey' = $providedPrivateKey + Name = $Name + Version = [string]::IsNullOrEmpty($Version) ? 'latest' : $Version + Prerelease = $Prerelease + 'Already installed' = $null -ne $alreadyInstalled + 'Already imported' = $null -ne $alreadyImported + 'Provided Token' = $providedToken + 'Provided ClientID' = $providedClientID + 'Provided PrivateKey' = $providedPrivateKey 'Provided KeyVaultKeyReference' = $providedKeyVaultKeyReference } if ($showInit) { @@ -116,9 +116,9 @@ process { Connect-GitHub @params } elseif ($providedClientID -and $providedKeyVaultKeyReference) { $params = @{ - ClientID = $env:PSMODULE_GITHUB_SCRIPT_INPUT_ClientID - KeyVaultKeyReference = $env:PSMODULE_GITHUB_SCRIPT_INPUT_KeyVaultKeyReference - Silent = (-not $showInit) + ClientID = $env:PSMODULE_GITHUB_SCRIPT_INPUT_ClientID + KeyVaultKeyReference = $env:PSMODULE_GITHUB_SCRIPT_INPUT_KeyVaultKeyReference + Silent = (-not $showInit) } Connect-GitHub @params } elseif ($providedToken) {