From 4ba5d719d8f304d9eb083ce79d355d3505a6bcc1 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 23 Dec 2024 13:28:18 +0100 Subject: [PATCH 1/3] add new personal access tokens for organization and user account --- .github/workflows/CI.yml | 12 ++++++++---- .github/workflows/workflow.yml | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3a10f8e6..08765c60 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -12,11 +12,14 @@ on: TEST_APP_PRIVATE_KEY: description: The private key for the test application required: false - TEST_FG_PAT: - description: The personal access token for the test application + TEST_FG_ORG_PAT: + description: The personal access token with access to the test organization + required: false + TEST_FG_USER_PAT: + description: The personal access token with access to the user account required: false TEST_PAT: - description: The personal access token for the test application + description: The personal access token for the test account 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..00ebe9bf 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -12,11 +12,14 @@ on: TEST_APP_PRIVATE_KEY: description: The private key for the test application required: false - TEST_FG_PAT: - description: The personal access token for the test application + TEST_FG_ORG_PAT: + description: The personal access token with access to the test organization + required: false + TEST_FG_USER_PAT: + description: The personal access token with access to the user account required: false TEST_PAT: - description: The personal access token for the test application + description: The personal access token for the test account 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: From 94c3a39b1a6b02550086c501357c1f7726443d12 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 23 Dec 2024 13:33:58 +0100 Subject: [PATCH 2/3] Update docs --- .github/workflows/CI.yml | 12 ++++++------ .github/workflows/workflow.yml | 12 ++++++------ README.md | 7 ++++--- 3 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 08765c60..d8a494a2 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -4,22 +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_ORG_PAT: - description: The personal access token with access to the test organization + description: The fine-grained personal access token with org access for running tests. required: false TEST_FG_USER_PAT: - description: The personal access token with access to the user account + 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 account + description: The classic personal access token for running tests. required: false inputs: Name: diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index 00ebe9bf..77cc7f6d 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -4,22 +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_ORG_PAT: - description: The personal access token with access to the test organization + description: The fine-grained personal access token with org access for running tests. required: false TEST_FG_USER_PAT: - description: The personal access token with access to the user account + 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 account + description: The classic personal access token for running tests. required: false inputs: Name: 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 From 6b93e0e251672e1d292e587fa94868d80ec0f6b7 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Mon, 23 Dec 2024 13:39:41 +0100 Subject: [PATCH 3/3] test --- tests/tests/PSModuleTest.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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