|
37 | 37 | TEST_APP_ORG_PRIVATE_KEY: |
38 | 38 | description: Private Key for the test GitHub App for the organization |
39 | 39 | required: true |
| 40 | + KEYVAULT_KEY_REFERENCE: |
| 41 | + description: Azure KeyVault key reference URL for GitHub App authentication |
| 42 | + required: true |
40 | 43 |
|
41 | 44 | permissions: |
42 | 45 | contents: read |
43 | 46 | pull-requests: read |
| 47 | + id-token: write |
44 | 48 |
|
45 | 49 | jobs: |
46 | 50 | ActionTestBasic: |
@@ -542,6 +546,104 @@ jobs: |
542 | 546 | Get-GitHubConfig | Format-List | Out-String |
543 | 547 | } |
544 | 548 |
|
| 549 | + ActionTestWithKeyVaultKeyReference: |
| 550 | + name: WithKeyVaultKeyReference |
| 551 | + environment: azure |
| 552 | + runs-on: ${{ inputs.runs-on }} |
| 553 | + steps: |
| 554 | + # Need to check out as part of the test, as its a local action |
| 555 | + - name: Checkout repo |
| 556 | + uses: actions/checkout@v4 |
| 557 | + |
| 558 | + # Login to Azure to enable KeyVault access |
| 559 | + - name: Login to Azure |
| 560 | + uses: azure/login@v2 |
| 561 | + with: |
| 562 | + client-id: ${{ vars.AZURE_CLIENT_ID }} |
| 563 | + tenant-id: ${{ vars.AZURE_TENANT_ID }} |
| 564 | + subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} |
| 565 | + allow-no-subscriptions: true |
| 566 | + |
| 567 | + - name: Action-Test |
| 568 | + uses: ./ |
| 569 | + with: |
| 570 | + ClientID: ${{ secrets.TEST_APP_ORG_CLIENT_ID }} |
| 571 | + KeyVaultKeyReference: 'https://psmodule-test-vault.vault.azure.net/keys/psmodule-org-app/569ae34250e64adca6a2b2d159d454a5' |
| 572 | + Prerelease: ${{ inputs.Prerelease }} |
| 573 | + Script: | |
| 574 | + LogGroup 'Context details' { |
| 575 | + Get-GitHubContext | Select-Object * | Out-String |
| 576 | + } |
| 577 | +
|
| 578 | + LogGroup 'Get-GitHubApp' { |
| 579 | + Get-GitHubApp | Format-List | Out-String |
| 580 | + } |
| 581 | +
|
| 582 | + LogGroup 'Get-GitHubAppInstallation' { |
| 583 | + Get-GitHubAppInstallation | Format-Table -AutoSize | Out-String |
| 584 | + } |
| 585 | +
|
| 586 | + LogGroup 'Connect to all installations of the app' { |
| 587 | + Connect-GitHubApp |
| 588 | + } |
| 589 | +
|
| 590 | + LogGroup 'Contexts' { |
| 591 | + Get-GitHubContext -ListAvailable | Format-Table -AutoSize | Out-String |
| 592 | + } |
| 593 | +
|
| 594 | + LogGroup 'GitHubConfig' { |
| 595 | + Get-GitHubConfig | Format-List | Out-String |
| 596 | + } |
| 597 | +
|
| 598 | + ActionTestWithKeyVaultKeyReferenceLatest: |
| 599 | + name: WithKeyVaultKeyReferenceLatest |
| 600 | + environment: azure |
| 601 | + runs-on: ${{ inputs.runs-on }} |
| 602 | + steps: |
| 603 | + # Need to check out as part of the test, as its a local action |
| 604 | + - name: Checkout repo |
| 605 | + uses: actions/checkout@v4 |
| 606 | + |
| 607 | + # Login to Azure to enable KeyVault access |
| 608 | + - name: Login to Azure |
| 609 | + uses: azure/login@v2 |
| 610 | + with: |
| 611 | + client-id: ${{ vars.AZURE_CLIENT_ID }} |
| 612 | + tenant-id: ${{ vars.AZURE_TENANT_ID }} |
| 613 | + subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }} |
| 614 | + allow-no-subscriptions: true |
| 615 | + |
| 616 | + - name: Action-Test |
| 617 | + uses: ./ |
| 618 | + with: |
| 619 | + ClientID: ${{ secrets.TEST_APP_ORG_CLIENT_ID }} |
| 620 | + KeyVaultKeyReference: 'https://psmodule-test-vault.vault.azure.net/keys/psmodule-org-app/' |
| 621 | + Prerelease: ${{ inputs.Prerelease }} |
| 622 | + Script: | |
| 623 | + LogGroup 'Context details' { |
| 624 | + Get-GitHubContext | Select-Object * | Out-String |
| 625 | + } |
| 626 | +
|
| 627 | + LogGroup 'Get-GitHubApp' { |
| 628 | + Get-GitHubApp | Format-List | Out-String |
| 629 | + } |
| 630 | +
|
| 631 | + LogGroup 'Get-GitHubAppInstallation' { |
| 632 | + Get-GitHubAppInstallation | Format-Table -AutoSize | Out-String |
| 633 | + } |
| 634 | +
|
| 635 | + LogGroup 'Connect to all installations of the app' { |
| 636 | + Connect-GitHubApp |
| 637 | + } |
| 638 | +
|
| 639 | + LogGroup 'Contexts' { |
| 640 | + Get-GitHubContext -ListAvailable | Format-Table -AutoSize | Out-String |
| 641 | + } |
| 642 | +
|
| 643 | + LogGroup 'GitHubConfig' { |
| 644 | + Get-GitHubConfig | Format-List | Out-String |
| 645 | + } |
| 646 | +
|
545 | 647 | ActionTestPreserveCredentialsFalse: |
546 | 648 | name: PreserveCredentials False |
547 | 649 | runs-on: ${{ inputs.runs-on }} |
|
0 commit comments