Update workflows to use short-lived dispatch tokens - #38
Closed
ColinDaglish wants to merge 0 commit into
Closed
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Masked installation tokens cannot propagate through job outputs, breaking the new caller flow, and one ADR example contains invalid YAML.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Moves dispatch authentication to caller-minted, short-lived GitHub App tokens and adds downstream revocation.
Changes:
- Replaces private-key forwarding with scoped installation tokens.
- Adds token minting, revocation, and concurrency controls.
- Updates security architecture and usage documentation.
File summaries
| File | Description |
|---|---|
.github/workflows/add-issue-to-projects.yml |
Accepts and revokes dispatch tokens. |
.github/workflows/add-pr-to-projects.yml |
Accepts and revokes dispatch tokens. |
.github/workflows/test-add-issue-to-projects-reusable.yml |
Adds token minting and concurrency. |
.github/workflows/test-add-pr-to-projects-reusable.yml |
Adds token minting and concurrency. |
.github/copilot-instructions.md |
Records the new credential model. |
docs/how-to/use-add-issue-to-projects-workflow.md |
Updates caller example. |
docs/how-to/use-add-pr-to-projects-workflow.md |
Updates caller example. |
docs/reference/reusable-workflows.md |
Documents token lifecycle and contract. |
docs/reference/github-apps.md |
Clarifies router credential usage. |
docs/explanation/ADR-0001-called-workflow-owns-secret-usage.md |
Updates the credential-boundary decision. |
docs/explanation/ADR-0004-separate-reusable-pinning-from-dispatch-ref.md |
Updates the SHA-pinned caller example. |
Review details
- Files reviewed: 11/11 changed files
- Comments generated: 7
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+31
to
+32
| outputs: | ||
| token: ${{ steps.app-token.outputs.token }} |
Comment on lines
+32
to
+33
| outputs: | ||
| token: ${{ steps.app-token.outputs.token }} |
Comment on lines
+52
to
+53
| outputs: | ||
| token: ${{ steps.app-token.outputs.token }} |
Comment on lines
+38
to
+39
| outputs: | ||
| token: ${{ steps.app-token.outputs.token }} |
Comment on lines
+39
to
+40
| outputs: | ||
| token: ${{ steps.app-token.outputs.token }} |
| - `PROJECT_ROUTER_BOT_APP_ID` (Actions variable, org-level) | ||
| - `PROJECT_ROUTER_BOT_PRIVATE_KEY` (Actions secret, org-level) | ||
|
|
||
| Callers mint the token in a separate job with `actions/create-github-app-token`, scoped to `datasciencecampus/github-actions` with only `actions: write`. They pass the resulting token to the public reusable workflow as `PROJECT_ROUTER_BOT_TOKEN`; the private key does not cross that workflow boundary. Because the token is consumed by a later job, the minting action must set `skip-token-revoke: true`. The reusable workflow revokes the token after the dispatch attempt, with its one-hour expiry as a fallback if cleanup cannot run. |
Comment on lines
+55
to
+59
| - id: app-token | ||
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | ||
| with: | ||
| client-id: ${{ vars.PROJECT_ROUTER_BOT_APP_ID }} | ||
| private-key: ${{ secrets.PROJECT_ROUTER_BOT_PRIVATE_KEY }} |
ColinDaglish
force-pushed
the
37-fix-workflow-call-issue-so-that-private-key-is-not-passed-down
branch
from
September 2, 2026 11:53
77d1465 to
4dcd9a0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Overview
This change enhances security by implementing short-lived dispatch tokens for workflows, ensuring that sensitive credentials are not passed down unnecessarily.
What Changed
PROJECT_ROUTER_BOT_TOKEN.PROJECT_ROUTER_BOT_PRIVATE_KEYin workflows with the new token.Validation
Reviewer Notes