diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d8a494a2..9b483fa9 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -6,19 +6,25 @@ on: APIKey: description: The API key for the PowerShell Gallery. required: true - TEST_APP_CLIENT_ID: - description: The client ID of an app for running tests. + TEST_APP_ENT_CLIENT_ID: + description: The client ID of an Enterprise GitHub App for running tests. required: false - TEST_APP_PRIVATE_KEY: - description: The private key of an app for running tests. + TEST_APP_ENT_PRIVATE_KEY: + description: The private key of an Enterprise GitHub App for running tests. required: false - TEST_FG_ORG_PAT: + TEST_APP_ORG_CLIENT_ID: + description: The client ID of an Organization GitHub App for running tests. + required: false + TEST_APP_ORG_PRIVATE_KEY: + description: The private key of an Organization GitHub App for running tests. + required: false + TEST_USER_ORG_FG_PAT: description: The fine-grained personal access token with org access for running tests. required: false - TEST_FG_USER_PAT: + TEST_USER_USER_FG_PAT: description: The fine-grained personal access token with user account access for running tests. required: false - TEST_PAT: + TEST_USER_PAT: description: The classic personal access token for running tests. required: false inputs: @@ -78,11 +84,13 @@ on: env: GITHUB_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication - TEST_APP_CLIENT_ID: ${{ secrets.TEST_APP_CLIENT_ID }} - TEST_APP_PRIVATE_KEY: ${{ secrets.TEST_APP_PRIVATE_KEY }} - TEST_FG_ORG_PAT: ${{ secrets.TEST_FG_ORG_PAT }} - TEST_FG_USER_PAT: ${{ secrets.TEST_FG_USER_PAT }} - TEST_PAT: ${{ secrets.TEST_PAT }} + TEST_APP_ENT_CLIENT_ID: ${{ secrets.TEST_APP_ENT_CLIENT_ID }} + TEST_APP_ENT_PRIVATE_KEY: ${{ secrets.TEST_APP_ENT_PRIVATE_KEY }} + TEST_APP_ORG_CLIENT_ID: ${{ secrets.TEST_APP_ORG_CLIENT_ID }} + TEST_APP_ORG_PRIVATE_KEY: ${{ secrets.TEST_APP_ORG_PRIVATE_KEY }} + TEST_USER_ORG_FG_PAT: ${{ secrets.TEST_USER_ORG_FG_PAT }} + TEST_USER_USER_FG_PAT: ${{ secrets.TEST_USER_USER_FG_PAT }} + TEST_USER_PAT: ${{ secrets.TEST_USER_PAT }} permissions: contents: read # to checkout the repository diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 77cc7f6d..99e04527 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -6,19 +6,25 @@ on: APIKey: description: The API key for the PowerShell Gallery. required: true - TEST_APP_CLIENT_ID: - description: The client ID of an app for running tests. + TEST_APP_ENT_CLIENT_ID: + description: The client ID of an Enterprise GitHub App for running tests. required: false - TEST_APP_PRIVATE_KEY: - description: The private key of an app for running tests. + TEST_APP_ENT_PRIVATE_KEY: + description: The private key of an Enterprise GitHub App for running tests. required: false - TEST_FG_ORG_PAT: + TEST_APP_ORG_CLIENT_ID: + description: The client ID of an Organization GitHub App for running tests. + required: false + TEST_APP_ORG_PRIVATE_KEY: + description: The private key of an Organization GitHub App for running tests. + required: false + TEST_USER_ORG_FG_PAT: description: The fine-grained personal access token with org access for running tests. required: false - TEST_FG_USER_PAT: + TEST_USER_USER_FG_PAT: description: The fine-grained personal access token with user account access for running tests. required: false - TEST_PAT: + TEST_USER_PAT: description: The classic personal access token for running tests. required: false inputs: @@ -83,11 +89,13 @@ on: env: GITHUB_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication - TEST_APP_CLIENT_ID: ${{ secrets.TEST_APP_CLIENT_ID }} - TEST_APP_PRIVATE_KEY: ${{ secrets.TEST_APP_PRIVATE_KEY }} - TEST_FG_ORG_PAT: ${{ secrets.TEST_FG_ORG_PAT }} - TEST_FG_USER_PAT: ${{ secrets.TEST_FG_USER_PAT }} - TEST_PAT: ${{ secrets.TEST_PAT }} + TEST_APP_ENT_CLIENT_ID: ${{ secrets.TEST_APP_ENT_CLIENT_ID }} + TEST_APP_ENT_PRIVATE_KEY: ${{ secrets.TEST_APP_ENT_PRIVATE_KEY }} + TEST_APP_ORG_CLIENT_ID: ${{ secrets.TEST_APP_ORG_CLIENT_ID }} + TEST_APP_ORG_PRIVATE_KEY: ${{ secrets.TEST_APP_ORG_PRIVATE_KEY }} + TEST_USER_ORG_FG_PAT: ${{ secrets.TEST_USER_ORG_FG_PAT }} + TEST_USER_USER_FG_PAT: ${{ secrets.TEST_USER_USER_FG_PAT }} + TEST_USER_PAT: ${{ secrets.TEST_USER_PAT }} permissions: contents: write # to checkout the repo and create releases on the repo diff --git a/README.md b/README.md index 02f0266a..ac30dfc6 100644 --- a/README.md +++ b/README.md @@ -91,11 +91,13 @@ in the workflow file. | ---- | -------- | ----------- | ------- | | `GITHUB_TOKEN` | `github` context | The token used to authenticate with GitHub. | `${{ secrets.GITHUB_TOKEN }}` | | `APIKey` | GitHub secrets | The API key for the PowerShell Gallery. | N/A | -| `TEST_APP_CLIENT_ID` | GitHub secrets | The client ID of an app for running tests. | N/A | -| `TEST_APP_PRIVATE_KEY` | GitHub secrets | The private key of an app for running tests. | N/A | -| `TEST_FG_ORG_PAT` | GitHub secrets | The fine-grained personal access token with org access for running tests. | N/A | -| `TEST_FG_USER_PAT` | GitHub secrets | The fine-grained personal access token with user account access for running tests. | N/A | -| `TEST_PAT` | GitHub secrets | The classic personal access token for running tests. | N/A | +| `TEST_APP_ENT_CLIENT_ID` | GitHub secrets | The client ID of an Enterprise GitHub App for running tests. | N/A | +| `TEST_APP_ENT_PRIVATE_KEY` | GitHub secrets | The private key of an Enterprise GitHub App for running tests. | N/A | +| `TEST_APP_ORG_CLIENT_ID` | GitHub secrets | The client ID of an Organization GitHub App for running tests. | N/A | +| `TEST_APP_ORG_PRIVATE_KEY` | GitHub secrets | The private key of an Organization GitHub App for running tests. | N/A | +| `TEST_USER_ORG_FG_PAT` | GitHub secrets | The fine-grained personal access token with org access for running tests. | N/A | +| `TEST_USER_USER_FG_PAT` | GitHub secrets | The fine-grained personal access token with user account access for running tests. | N/A | +| `TEST_USER_PAT` | GitHub secrets | The classic personal access token for running tests. | N/A | ## Permissions diff --git a/tests/tests/PSModuleTest.Tests.ps1 b/tests/tests/PSModuleTest.Tests.ps1 index b92061f7..2be65edb 100644 --- a/tests/tests/PSModuleTest.Tests.ps1 +++ b/tests/tests/PSModuleTest.Tests.ps1 @@ -6,9 +6,16 @@ Param( ) Write-Verbose "Path to the module: [$Path]" -Verbose - Describe 'Environment Variables are available' { - It 'Should be available [<_>]' -ForEach @('TEST_APP_CLIENT_ID', 'TEST_APP_PRIVATE_KEY', 'TEST_FG_ORG_PAT', 'TEST_FG_USER_PAT', 'TEST_PAT') { + It 'Should be available [<_>]' -ForEach @( + 'TEST_APP_ENT_CLIENT_ID', + 'TEST_APP_ENT_PRIVATE_KEY', + 'TEST_APP_ORG_CLIENT_ID', + 'TEST_APP_ORG_PRIVATE_KEY', + 'TEST_USER_ORG_FG_PAT', + 'TEST_USER_USER_FG_PAT', + 'TEST_USER_PAT' + ) { $name = $_ Write-Verbose "Environment variable: [$name]" -Verbose Get-ChildItem env: | Where-Object { $_.Name -eq $name } | Should -Not -BeNullOrEmpty