Skip to content

Commit a605ffe

Browse files
Complete GitHub App caller contract
Route the release action through Shelly's scoped installation token and update every canonical workflow example for the required GitHub App secrets. Document the separate Dependabot secret requirement. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 1fdefd1 commit a605ffe

6 files changed

Lines changed: 22 additions & 5 deletions

File tree

.github/workflows/Publish-Module.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ jobs:
7070
if: always() && !cancelled() && fromJson(inputs.Settings).Publish.Module.Resolution.ReleaseType != 'None'
7171
uses: ./_wf/.github/actions/Release-PSModule
7272
env:
73-
GH_TOKEN: ${{ github.token }}
73+
GH_TOKEN: ${{ steps.App-Token.outputs.token }}
7474
with:
7575
Name: ${{ fromJson(inputs.Settings).Name }}
7676
ModulePath: outputs/module

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ jobs:
6464
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v5
6565
secrets:
6666
APIKey: ${{ secrets.APIKey }}
67+
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
68+
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
6769
```
6870
6971
Every permission in that block is required. See [Workflow inputs](../reference/workflow-inputs.md) for what each one is

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,19 @@ jobs:
4747
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v5
4848
secrets:
4949
APIKey: ${{ secrets.APIKey }}
50+
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
51+
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
5052
```
5153
5254
</details>
5355
5456
## Passing test data
5557
56-
The reusable workflow at `.github/workflows/workflow.yml` declares only two workflow-call secrets,
58+
The reusable workflow at `.github/workflows/workflow.yml` declares four workflow-call secrets,
5759
which keeps the calling workflow in full control of the credentials that are exposed.
58-
`secrets: inherit` is intentionally not required. `APIKey` publishes to the PowerShell Gallery; `TestData` carries
59-
everything the module's own tests need.
60+
`secrets: inherit` is intentionally not required. `APIKey` publishes to the PowerShell Gallery,
61+
`GitHubAppClientId` and `GitHubAppPrivateKey` authenticate GitHub API operations, and `TestData`
62+
carries everything the module's own tests need.
6063

6164
### Breaking change: fixed test secrets use `TestData`
6265

@@ -80,6 +83,8 @@ jobs:
8083
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v5
8184
secrets:
8285
APIKey: ${{ secrets.APIKey }}
86+
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
87+
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
8388
TestData: >-
8489
{ "secrets": { "TEST_USER_PAT": "${{ secrets.TEST_USER_PAT }}",
8590
"TEST_APP_ORG_CLIENT_ID": "${{ secrets.TEST_APP_ORG_CLIENT_ID }}" } }
@@ -107,6 +112,8 @@ jobs:
107112
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v5
108113
secrets:
109114
APIKey: ${{ secrets.APIKey }}
115+
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
116+
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
110117
TestData: >-
111118
{ "secrets": { "CONFLUENCE_API_TOKEN": "${{ secrets.CONFLUENCE_API_TOKEN }}" },
112119
"variables": { "CONFLUENCE_SITE": ${{ toJSON(vars.CONFLUENCE_SITE) }},

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ jobs:
3333
The root reusable workflow forwards these two values to the Plan, Build-Module, and Publish-Module reusable jobs.
3434
Do not use `secrets: inherit` as a substitute for this mapping.
3535

36+
For Dependabot pull requests, create `SHELLY_CLIENT_ID` and `SHELLY_PRIVATE_KEY` as Dependabot secrets as well as
37+
Actions secrets. Dependabot-triggered workflows cannot read regular Actions secrets, so the GitHub App token cannot
38+
be minted without separate Dependabot secret values.
39+
3640
## Token scope
3741

3842
Each job mints its own token with the repository that triggered the workflow:

docs/content/reference/repository-standard.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ jobs:
125125
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@<commit-sha> # <version tag>
126126
secrets:
127127
APIKey: ${{ secrets.APIKEY }}
128+
GitHubAppClientId: ${{ secrets.SHELLY_CLIENT_ID }}
129+
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
128130
```
129131
130132
Name the caller file `Process-PSModule.yml`, matching [`PSModule/Template-PSModule`](https://github.com/PSModule/Template-PSModule) and every existing module repository. `workflow.yml` is the reusable workflow's own filename inside `PSModule/Process-PSModule` and belongs only in the `uses:` reference. Pin the reference to a commit SHA with the version tag in a trailing comment so Dependabot can update it.

docs/content/reference/workflow-inputs.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@ interface it exposes to a caller workflow. For how to wire it up, see
2323

2424
## Secrets
2525

26-
The workflow declares only two workflow-call secrets, which keeps the calling workflow in full control of the
26+
The workflow declares four workflow-call secrets, which keeps the calling workflow in full control of the
2727
credentials that are exposed. `secrets: inherit` is intentionally not required.
2828

2929
| Name | Location | Description | Required |
3030
| ---- | -------- | ----------- | -------- |
3131
| `APIKey` | GitHub secrets | The API key for the PowerShell Gallery, used to publish the module. | Yes |
32+
| `GitHubAppClientId` | GitHub secrets | The GitHub App client ID used to mint scoped installation tokens for GitHub API operations. Map Shelly's `SHELLY_CLIENT_ID` in the caller. | Yes |
33+
| `GitHubAppPrivateKey` | GitHub secrets | The GitHub App private key used to mint scoped installation tokens for GitHub API operations. Map Shelly's `SHELLY_PRIVATE_KEY` in the caller. | Yes |
3234
| `TestData` | GitHub secrets | A single-line JSON object with `secrets` and `variables` maps, exposed as environment variables to the module test jobs. Values under `secrets` are masked; values under `variables` are not. | No |
3335

3436
See [passing test data](../guides/calling-the-workflow.md#passing-test-data) for how to build the `TestData` value.

0 commit comments

Comments
 (0)