diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3a10f8e6..d8a494a2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -4,19 +4,22 @@ on: workflow_call: secrets: APIKey: - description: The API key to use when publishing modules + description: The API key for the PowerShell Gallery. required: true TEST_APP_CLIENT_ID: - description: The client ID for the test application + description: The client ID of an app for running tests. required: false TEST_APP_PRIVATE_KEY: - description: The private key for the test application + description: The private key of an app for running tests. required: false - TEST_FG_PAT: - description: The personal access token for the test application + TEST_FG_ORG_PAT: + description: The fine-grained personal access token with org access for running tests. + required: false + TEST_FG_USER_PAT: + description: The fine-grained personal access token with user account access for running tests. required: false TEST_PAT: - description: The personal access token for the test application + description: The classic personal access token for running tests. required: false inputs: Name: @@ -77,7 +80,8 @@ 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_PAT: ${{ secrets.TEST_FG_PAT }} + TEST_FG_ORG_PAT: ${{ secrets.TEST_FG_ORG_PAT }} + TEST_FG_USER_PAT: ${{ secrets.TEST_FG_USER_PAT }} TEST_PAT: ${{ secrets.TEST_PAT }} permissions: diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index d60beee3..77cc7f6d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -4,19 +4,22 @@ on: workflow_call: secrets: APIKey: - description: The API key to use when publishing modules + description: The API key for the PowerShell Gallery. required: true TEST_APP_CLIENT_ID: - description: The client ID for the test application + description: The client ID of an app for running tests. required: false TEST_APP_PRIVATE_KEY: - description: The private key for the test application + description: The private key of an app for running tests. required: false - TEST_FG_PAT: - description: The personal access token for the test application + TEST_FG_ORG_PAT: + description: The fine-grained personal access token with org access for running tests. + required: false + TEST_FG_USER_PAT: + description: The fine-grained personal access token with user account access for running tests. required: false TEST_PAT: - description: The personal access token for the test application + description: The classic personal access token for running tests. required: false inputs: Name: @@ -82,7 +85,8 @@ 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_PAT: ${{ secrets.TEST_FG_PAT }} + TEST_FG_ORG_PAT: ${{ secrets.TEST_FG_ORG_PAT }} + TEST_FG_USER_PAT: ${{ secrets.TEST_FG_USER_PAT }} TEST_PAT: ${{ secrets.TEST_PAT }} permissions: diff --git a/README.md b/README.md index 9eeab7fe..02f0266a 100644 --- a/README.md +++ b/README.md @@ -91,9 +91,10 @@ 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 for running tests. | N/A | -| `TEST_APP_PRIVATE_KEY` | GitHub secrets | The private key for running tests. | N/A | -| `TEST_FG_PAT` | GitHub secrets | The fine-grained personal access token for running tests. | 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 | ## Permissions diff --git a/tests/tests/PSModuleTest.Tests.ps1 b/tests/tests/PSModuleTest.Tests.ps1 index e17ad000..b92061f7 100644 --- a/tests/tests/PSModuleTest.Tests.ps1 +++ b/tests/tests/PSModuleTest.Tests.ps1 @@ -8,7 +8,7 @@ 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_PAT', 'TEST_PAT') { + It 'Should be available [<_>]' -ForEach @('TEST_APP_CLIENT_ID', 'TEST_APP_PRIVATE_KEY', 'TEST_FG_ORG_PAT', 'TEST_FG_USER_PAT', 'TEST_PAT') { $name = $_ Write-Verbose "Environment variable: [$name]" -Verbose Get-ChildItem env: | Where-Object { $_.Name -eq $name } | Should -Not -BeNullOrEmpty