Skip to content

Commit 52f34a8

Browse files
Refine the workflow token boundary
Co-authored-by: Copilot App <[email protected]>
1 parent d7a63a5 commit 52f34a8

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

docs/content/reference/process-workflow-fleet-standard.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ permissions: {}
114114

115115
jobs:
116116
Process-PSModule:
117+
permissions:
118+
contents: read
119+
pages: write
120+
id-token: write
117121
if: ${{ github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository }}
118122
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v8
119123
secrets:
@@ -132,7 +136,7 @@ decisions before canonical guides, templates, or consumer workflows adopt it:
132136
| Trigger ownership | The caller owns manual, schedule, default-branch push, and pull-request triggers. | Move some trigger policy into separate workflows or omit selected event classes. |
133137
| Pull-request activities | Keep all six listed activity types. | Reduce the activity list if a v8 behavior is intentionally unsupported. |
134138
| Concurrency | Use the workflow plus PR-number-or-full-ref key and cancel only pull-request runs. | Selected for the candidate: PR reconciliation must be resumable; non-PR runs serialize by full ref. |
135-
| Permissions | Set caller permissions to `{}` and use scoped GitHub App tokens inside the reusable workflow. | Selected for the candidate; built-in `GITHUB_TOKEN` authority must not be required. |
139+
| Permissions | Default deny at workflow level, then grant the caller job `contents: read`, `pages: write`, and `id-token: write`. | Selected for the candidate: use `GITHUB_TOKEN` for repository-local, non-user-facing platform operations and App tokens for user-facing or otherwise unsupported operations. |
136140
| Fork behavior | Skip fork-originated pull requests in this credentialed wrapper. | Add a separate secret-free workflow or define another supported fork-validation design. |
137141
| Credentials | Explicitly map the three v8 credentials. | Define a narrower credential profile for repositories that cannot publish. |
138142
| Optional surface | Permit only documented `TestData`, workflow inputs, schedule timing, and presentation metadata. | Allow additional extension points after naming and compatibility rules are agreed. |
@@ -167,7 +171,7 @@ fleet campaign. Branch names, `latest`, floating minor tags, and unqualified tar
167171
| Manual dispatch | Keep `workflow_dispatch`. | Provides the documented default-branch manual release and recovery path. |
168172
| Schedule | Keep a scheduled health run. | Exercises current dependencies even when repository code is unchanged. |
169173
| Concurrency | Use the PR-number-or-ref key and cancel only pull-request runs. | New PR events supersede older declarative reconciliation runs; same-ref push, dispatch, and schedule runs serialize without cancellation. |
170-
| Permissions | Set top-level `permissions: {}` and grant no caller-job permissions. | Repository access and mutations use narrowly scoped GitHub App installation tokens created inside the reusable workflow. |
174+
| Permissions | Set top-level `permissions: {}` and grant only `contents: read`, `pages: write`, and `id-token: write` to the caller job. | Checkout and Pages remain repository-local built-in capabilities; user-facing interactions and operations outside the built-in token boundary use scoped GitHub App tokens. |
171175
| Fork guard | Skip pull requests whose head repository differs from `github.repository`. | GitHub withholds the required repository secrets from fork pull requests. |
172176
| Reference | Use the intended internal floating major tag (`v8`) after tag governance is enforced. | Compatible owned releases roll out centrally; breaking releases require a new major and campaign. |
173177
| Credentials | Explicitly map the three required secrets. | Satisfies the `v7+` contract and prevents unrelated secret inheritance. |
@@ -200,13 +204,13 @@ an approved structure:
200204
- a concurrency key other than workflow plus PR number or full ref, or cancellation behavior other than pull-request-only;
201205
- trigger-level path filters that bypass Process-PSModule important-file evaluation;
202206
- unrelated additional jobs in the caller wrapper;
203-
- any built-in `GITHUB_TOKEN` permission granted by the caller.
207+
- caller permissions beyond `contents: read`, `pages: write`, and `id-token: write`.
204208

205-
The current v8 implementation still uses built-in token authority for checkout, linter status/reporting, and the standard
206-
GitHub Pages deployment action. Before adopting the empty-permissions caller, each job must create a narrowly scoped
207-
GitHub App installation token before checkout and pass it explicitly to checkout, GitHub CLI, and reporting actions.
208-
Pages publication must either move to an App-authenticated deployment path or document the unavoidable `pages`/OIDC
209-
exception if the standard Pages action remains.
209+
Use the built-in `GITHUB_TOKEN` for non-user-facing operations confined to the calling repository, including checkout
210+
and the standard GitHub Pages deployment. Create narrowly scoped GitHub App installation tokens for user-facing
211+
interactions such as pull-request comments, labels, statuses, releases, and release cleanup, and whenever the built-in
212+
token cannot provide the required repository or cross-repository access. Tokens remain step-scoped and must not fall
213+
back silently from App authorization to broader built-in-token authority.
210214

211215
Fork-originated pull requests are skipped by the candidate caller because reusable-workflow caller jobs cannot select a
212216
GitHub Environment and repository secrets are unavailable to forks. Supporting fork CI requires a separate, secret-free,

0 commit comments

Comments
 (0)