Skip to content

Commit 9a654b8

Browse files
Rename PowerShell Gallery workflow credential
Replace the ambiguous APIKey workflow secret with PSGALLERY_API_KEY across the reusable workflow contract, test callers, and documentation. Keep the Publish-PSModule action input unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent bb66b8f commit 9a654b8

11 files changed

Lines changed: 19 additions & 17 deletions

File tree

.github/actions/Publish-PSModule/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This action does not provide outputs.
2626
Name: ExampleModule
2727
ModulePath: outputs/module
2828
ArtifactName: module
29-
APIKey: ${{ secrets.APIKEY }}
29+
APIKey: ${{ secrets.PSGALLERY_API_KEY }}
3030
```
3131
3232
Use [Release-PSModule](../Release-PSModule/README.md) in a separate workflow step to create the GitHub release from the same artifact.

.github/workflows/Publish-Module.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish-Module
33
on:
44
workflow_call:
55
secrets:
6-
APIKey:
6+
PSGALLERY_API_KEY:
77
description: The API key for the PowerShell Gallery.
88
required: true
99
GitHubAppClientId:
@@ -61,7 +61,7 @@ jobs:
6161
with:
6262
Name: ${{ fromJson(inputs.Settings).Name }}
6363
ModulePath: outputs/module
64-
APIKey: ${{ secrets.APIKey }}
64+
APIKey: ${{ secrets.PSGALLERY_API_KEY }}
6565
WhatIf: ${{ github.repository == 'PSModule/Process-PSModule' }}
6666
WorkingDirectory: ${{ fromJson(inputs.Settings).WorkingDirectory }}
6767

.github/workflows/Workflow-Test-Default.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
3131
uses: ./.github/workflows/workflow.yml
3232
secrets:
33-
APIKey: ${{ secrets.APIKey }}
33+
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
3434
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
3535
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
3636
TestData: >-

.github/workflows/Workflow-Test-WithManifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
3131
uses: ./.github/workflows/workflow.yml
3232
secrets:
33-
APIKey: ${{ secrets.APIKey }}
33+
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
3434
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
3535
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
3636
TestData: >-

.github/workflows/workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Process-PSModule
33
on:
44
workflow_call:
55
secrets:
6-
APIKey:
6+
PSGALLERY_API_KEY:
77
description: The API key for the PowerShell Gallery.
88
required: true
99
GitHubAppClientId:
@@ -257,7 +257,7 @@ jobs:
257257
if: fromJson(needs.Plan.outputs.Settings).Publish.Module.Enabled && needs.Plan.result == 'success' && !cancelled() && (needs.Get-TestResults.result == 'success' || needs.Get-TestResults.result == 'skipped') && (needs.Get-CodeCoverage.result == 'success' || needs.Get-CodeCoverage.result == 'skipped') && (needs.Build-Site.result == 'success' || needs.Build-Site.result == 'skipped')
258258
uses: ./.github/workflows/Publish-Module.yml
259259
secrets:
260-
APIKey: ${{ secrets.APIKey }}
260+
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
261261
GitHubAppClientId: ${{ secrets.GitHubAppClientId }}
262262
GitHubAppPrivateKey: ${{ secrets.GitHubAppPrivateKey }}
263263
needs:

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ It covers getting started, the pipeline stages, usage, configuration, repository
1414

1515
## Reusable workflow secrets (GitHub App auth)
1616

17-
When calling `./.github/workflows/workflow.yml`, pass GitHub App credentials using these generic reusable-workflow secret names:
17+
When calling `./.github/workflows/workflow.yml`, pass the PowerShell Gallery API key and GitHub App credentials using these reusable-workflow secret names:
1818

19+
- `PSGALLERY_API_KEY`
1920
- `GitHubAppClientId`
2021
- `GitHubAppPrivateKey`
2122

@@ -26,10 +27,11 @@ jobs:
2627
ProcessPSModule:
2728
uses: ./.github/workflows/workflow.yml
2829
secrets:
30+
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
2931
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
3032
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
3133
```
3234
33-
This is a required contract for GitHub operations in the reusable workflow path; a GitHub App installation token is minted and used for those steps via `GH_TOKEN`, and `github.token` fallback is intentionally not used.
35+
This is a required contract. `PSGALLERY_API_KEY` publishes the module to the PowerShell Gallery; the GitHub App credentials mint an installation token for GitHub operations via `GH_TOKEN`, with no `github.token` fallback in that path. This is a breaking rename from the previous `APIKey`/`APIKEY` workflow secret.
3436

3537
See the [GitHub App authentication guide](https://psmodule.io/docs/guides/github-app-authentication/) for the caller mapping, per-workflow permissions and repository scoping, and token injection details.

docs/content/get-started/repository-setup.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This creates an environment called `github-pages` that GitHub deploys the docume
2222

2323
1. [Create an API key on the PowerShell Gallery](https://www.powershellgallery.com/account/apikeys). Give it permission
2424
to manage the module you are working on.
25-
2. Create a repository secret called `APIKEY` and set the API key as its value.
25+
2. Create a repository secret called `PSGALLERY_API_KEY` and set the API key as its value.
2626

2727
If you plan to create many modules, use a glob pattern for the API key permissions in the PowerShell Gallery and store
2828
the secret on the organization instead of on each repository.
@@ -63,7 +63,7 @@ jobs:
6363
Process-PSModule:
6464
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v5
6565
secrets:
66-
APIKey: ${{ secrets.APIKey }}
66+
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
6767
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
6868
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
6969
```

docs/content/guides/calling-the-workflow.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
Process-PSModule:
4747
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v5
4848
secrets:
49-
APIKey: ${{ secrets.APIKey }}
49+
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
5050
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
5151
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
5252
```
@@ -82,7 +82,7 @@ jobs:
8282
Process-PSModule:
8383
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v5
8484
secrets:
85-
APIKey: ${{ secrets.APIKey }}
85+
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
8686
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
8787
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
8888
TestData: >-
@@ -111,7 +111,7 @@ jobs:
111111
Process-PSModule:
112112
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v5
113113
secrets:
114-
APIKey: ${{ secrets.APIKey }}
114+
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
115115
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
116116
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
117117
TestData: >-

docs/content/guides/github-app-authentication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
Process-PSModule:
2626
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v5
2727
secrets:
28-
APIKey: ${{ secrets.APIKey }}
28+
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
2929
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
3030
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
3131
```

docs/content/reference/repository-standard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
Process-PSModule:
125125
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@<commit-sha> # <version tag>
126126
secrets:
127-
APIKey: ${{ secrets.APIKEY }}
127+
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
128128
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
129129
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
130130
```

0 commit comments

Comments
 (0)