Skip to content

Commit ece9e53

Browse files
Add KeyVaultKeyReference authentication test
Co-authored-by: MariusStorhaug <17722253+MariusStorhaug@users.noreply.github.com>
1 parent 9fb13f6 commit ece9e53

File tree

1 file changed

+56
-0
lines changed

1 file changed

+56
-0
lines changed

.github/workflows/TestWorkflow.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ on:
3737
TEST_APP_ORG_PRIVATE_KEY:
3838
description: Private Key for the test GitHub App for the organization
3939
required: true
40+
AZURE_CLIENT_ID:
41+
description: Azure Client ID for KeyVault authentication
42+
required: true
43+
AZURE_TENANT_ID:
44+
description: Azure Tenant ID for KeyVault authentication
45+
required: true
46+
AZURE_SUBSCRIPTION_ID:
47+
description: Azure Subscription ID for KeyVault authentication
48+
required: true
49+
KEYVAULT_KEY_REFERENCE:
50+
description: Azure KeyVault key reference URL for GitHub App authentication
51+
required: true
4052

4153
permissions:
4254
contents: read
@@ -542,6 +554,50 @@ jobs:
542554
Get-GitHubConfig | Format-List | Out-String
543555
}
544556
557+
ActionTestWithKeyVaultKeyReference:
558+
name: WithKeyVaultKeyReference
559+
runs-on: ${{ inputs.runs-on }}
560+
steps:
561+
# Need to check out as part of the test, as its a local action
562+
- name: Checkout repo
563+
uses: actions/checkout@v4
564+
565+
# Login to Azure to enable KeyVault access
566+
- name: Login to Azure
567+
uses: azure/login@v1
568+
with:
569+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
570+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
571+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
572+
allow-no-subscriptions: true
573+
574+
- name: Action-Test
575+
uses: ./
576+
with:
577+
ClientID: ${{ secrets.AZURE_CLIENT_ID }}
578+
KeyVaultKeyReference: ${{ secrets.KEYVAULT_KEY_REFERENCE }}
579+
Prerelease: ${{ inputs.Prerelease }}
580+
Script: |
581+
LogGroup 'Get-GitHubApp' {
582+
Get-GitHubApp | Format-List | Out-String
583+
}
584+
585+
LogGroup 'Get-GitHubAppInstallation' {
586+
Get-GitHubAppInstallation | Format-Table -AutoSize | Out-String
587+
}
588+
589+
LogGroup 'Connect to all installations of the app' {
590+
Connect-GitHubApp
591+
}
592+
593+
LogGroup 'Contexts' {
594+
Get-GitHubContext -ListAvailable | Format-Table -AutoSize | Out-String
595+
}
596+
597+
LogGroup 'GitHubConfig' {
598+
Get-GitHubConfig | Format-List | Out-String
599+
}
600+
545601
ActionTestPreserveCredentialsFalse:
546602
name: PreserveCredentials False
547603
runs-on: ${{ inputs.runs-on }}

0 commit comments

Comments
 (0)