Repository navigation
Closed
Labels
area/ci-cdGitHub workflows, merge queue, gh-aw integrations, release pipeline.area/docs-sitedocs/src/content (Starlight), README, doc generation.area/multi-targetMulti-target deploy spec, target directory creation, agent surface routing.enhancementLegacy classification name; prefer type/feature. Retained for history.status/needs-designDesign discussion required before implementation; not scope approval by itself.status/triagedAutomated advice completed; deduplication only. Not human approval; silence is not approval.type/featureNew capability, new flag, new primitive.
Description
Summary
shared/apm.md currently exposes a single app-id/private-key/owner/repositories set per import (added in #982). For workflows that need to fetch private APM packages from multiple orgs using different GitHub Apps per source org, that's not enough.
Two structural blockers prevent simply importing shared/apm.md multiple times:
- Job name collision — gh-aw's import resolver merges jobs by key. The shared workflow defines
jobs.apm:(fixed name), so a second import would clobber the first. actions/create-github-app-tokenis single-owner — one mint = one installation token = one owner. Multi-org access in a single token isn't possible without a cross-org GitHub App installation.
Use case
A team consumes APM packages from multiple private orgs they don't own, each requiring its own GitHub App installation:
# Hypothetical, NOT supported today
imports:
- uses: shared/apm.md
with:
apps:
- app-id: ${{ vars.ACME_APP_ID }}
private-key: ${{ secrets.ACME_APP_PRIVATE_KEY }}
owner: acme-org
repositories: acme-skills
packages:
- acme-org/acme-skills/skills/code-review
- app-id: ${{ vars.BETA_APP_ID }}
private-key: ${{ secrets.BETA_APP_PRIVATE_KEY }}
owner: beta-org
packages:
- beta-org/beta-pkg
packages: # public, no app needed
- microsoft/apm-sample-packageWorkarounds available today
- One workflow per source org, each importing
shared/apm.mdwith its own credentials. Works, but splits the agent run. - One GitHub App installed in every source org (single
app-id/private-keyshared across orgs). Still requires a separateownerper token mint, so multiple mint steps in a forkedshared/apm.md. - Fork
shared/apm.mdlocally to chain Ncreate-github-app-token+ Napm-actionpack steps against the same workspace. Tractable for 2-3 orgs, ugly beyond.
Design constraints
- gh-aw
import-schemadocuments thatobjectinputs allow "one-level deep sub-fields" — arrays-of-objects are not cleanly supported and would need verification. - Dynamic step generation in static YAML is awkward; a matrix-strategy redesign or a dedicated composite action wrapping
microsoft/apm-actionmay be required. - Bundle merging across multiple pack runs needs to be defined (sequential append vs. separate artifacts).
Possible designs (non-exhaustive)
- Matrix-strategy pack — generate one matrix cell per app group, each cell mints its own token and packs its own bundle, then a final merge job concatenates artifacts.
- Composite action wrapper — a new action that takes a structured
apps:input, mints tokens, and invokesmicrosoft/apm-actiononce per group. - Documented multi-workflow split — codify "one workflow per source org" as the supported pattern and don't extend
shared/apm.md.
Out of scope for #982
#982 lands the single-app case (the most common path off the deprecated dependencies.github-app form). This issue tracks the broader multi-app/multi-org case as a follow-up.
Acceptance
- A documented, supported way to consume private APM packages from N orgs with N different GitHub Apps in a single agentic workflow, OR
- A clear "use one workflow per source org" recommendation in the docs if multi-app within one workflow is not pursued.
Metadata
Metadata
Assignees
Labels
area/ci-cdGitHub workflows, merge queue, gh-aw integrations, release pipeline.area/docs-sitedocs/src/content (Starlight), README, doc generation.area/multi-targetMulti-target deploy spec, target directory creation, agent surface routing.enhancementLegacy classification name; prefer type/feature. Retained for history.status/needs-designDesign discussion required before implementation; not scope approval by itself.status/triagedAutomated advice completed; deduplication only. Not human approval; silence is not approval.type/featureNew capability, new flag, new primitive.
Type
Projects
- StatusShow more project fieldsDone
Activity
danielmeppiel commentedon Apr 27, 2026
Design Proposal: Multi-org GitHub App auth in
shared/apm.mdTracking: microsoft/apm#983
Predecessor: microsoft/apm#982 (single-app — first-class, kept)
Disposition: APPROVED for execution as a two-PR sequence
TL;DR
Add
apps:(array of GitHub App credential groups) toshared/apm.md'simport-schema, fan out one matrix replica per group in theapmjob, and consume all resulting bundles in a single multi-bundle restore step. Each replica mints its own installation token viaactions/create-github-app-token, packs only its declared packages, and uploads a uniquely-named artifact. Pre-agent-steps download allapm-*artifacts and restore them via a newbundles-file:input onmicrosoft/apm-action.The single-app top-level form (
app-id,private-key,owner,repositories) shipped in #982 stays first-class as the canonical shorthand for the common case.apps[]is purely additive.Problem
shared/apm.mdexposes a singleapp-id/private-key/owner/repositoriesset per import. Workflows that consume APM packages from multiple orgs, each gated by a distinct GitHub App installation, have no supported path:shared/apm.mdtwice collides on the fixedjobs.apm:name (gh-aw merges imported jobs by key — seepkg/parser/import_field_extractor.go:360-363).actions/create-github-app-tokenmints one installation token per call (single-owner scope).Constraints validated against gh-aw upstream
import-schemasupportsarrayofobjectitems;validateImportInputTyperecurses into items viavalidateObjectInput(pkg/parser/import_field_extractor.go:603-722). Arrays-of-objects with named scalar sub-fields are valid.${{ github.aw.import-inputs.<array> }}substitutes as inline JSON (substituteImportInputsInContent,pkg/parser/import_field_extractor.go:798-812).${{ secrets.X }}references inside user-supplied values pass through as literal strings; GA evaluates them at runtime.matrix.<key>: ${{ fromJSON(needs.<job>.outputs.matrix) }}is a GA-canonical pattern for dynamic matrices.Approach
Three-stage pipeline inside the existing
apmreusable workflow:apm-prep(new, single job, no matrix): normalizepackages:+ top-level single-app inputs +apps[]into one canonical list of credential groups; emit as JSON output.apm(existing, withstrategy.matrix): one replica per group, conditional token mint, pack, upload artifact namedapm-<group-id>.apm-*artifacts, validate against the matrix manifest, restore in a singleapm-actioninvocation with the newbundles-file:input.Final architecture
OO / class diagram
classDiagram direction LR class SharedApmWorkflow { <<ReusableWorkflow>> +import-schema: packages, apps[], single-app +jobs: apm-prep, apm +pre-agent-steps: download, validate, restore } class ApmPrepJob { <<Initializer>> +outputs.matrix: JSON +normalize(packages, single-app, apps) ApmGroup[] } class ApmJob { <<MatrixIterator>> +strategy.matrix.group: ApmGroup +mint, pack, upload } class ApmGroup { <<ValueObject>> +id string +app-id string +private-key string +owner string +repositories string +packages string[] } class CreateGitHubAppToken { <<ConcreteStrategy>> +mints installation token per replica } class ApmAction { <<Adapter>> +pack mode +restore mode (bundles-file: NEW) } class PreAgentSteps { <<RestorePhase>> +download apm-* artifacts +validate against matrix manifest +restore via bundles-file } SharedApmWorkflow *-- ApmPrepJob SharedApmWorkflow *-- ApmJob SharedApmWorkflow *-- PreAgentSteps ApmJob *-- ApmGroup : iterates ApmJob ..> CreateGitHubAppToken : conditional ApmJob ..> ApmAction : pack PreAgentSteps ..> ApmAction : restore note for ApmJob "Strategy fan-out: matrix.group selects credential and package set per replica" note for ApmAction "NEW upstream input: bundles-file (newline-list)" class SharedApmWorkflow:::touched class ApmPrepJob:::touched class ApmJob:::touched class ApmGroup:::touched class PreAgentSteps:::touched classDef touched fill:#fff3b0,stroke:#d47600Execution flow
flowchart TD A[Workflow trigger] --> B[activation job] B --> C[apm-prep job] C -->|"[EXEC] jq normalize, validate ids"| D{matrix size N} D --> E1["apm group=default<br/>no mint -> [NET] apm-action pack -> [I/O] upload apm-default"] D --> E2["apm group=acme<br/>[NET] create-github-app-token -> [NET] apm-action pack -> [I/O] upload apm-acme"] D --> E3["apm group=beta<br/>[NET] create-github-app-token -> [NET] apm-action pack -> [I/O] upload apm-beta"] E1 --> F[agent job] E2 --> F E3 --> F F --> G["pre-agent-steps:<br/>[I/O] download-artifact pattern apm-*<br/>[FS] validate count vs matrix manifest<br/>[FS] write bundle list<br/>[EXEC] apm-action bundles-file"] G --> H[agent execution with merged apm_modules/]Design patterns
apm-actionaccumulates more than two multi-bundle quirks, extract amicrosoft/apm-awcomposite action that wraps the matrix machinery; not now.import-schema(final)Workflow shape
User-facing forms (three side-by-side, in HTML doc-comment)
Per-persona findings (panel review)
Python Architect
Strategy fan-out via
matrix.group,ApmGroupValueObject, and theapm-prepInitializer fit the existing APM pattern set cleanly. The two-job split (apm-prep->apm[matrix]) eliminates the need for compile-time matrix synthesis.jqchosen overpython3for runner-portability. Diagrams and Design-patterns subsection above.GH Actions Workflows Expert (co-lead)
fromJSON(needs.<job>.outputs.matrix)is the canonical GA pattern for dynamic matrices; secrets references inside JSON-marshaledapps[]survive substitution and are evaluated by GA at runtime.pattern: apm-*onactions/download-artifact@v8enables wildcard discovery. Cache strategy (per-group cache key) deferred to a follow-up alignment with upstreamgh-aw/.github/workflows/shared/apm.md.CLI Logging Expert
::notice::per bundle) is REQUIRED in the upstreamapm-actionbundles-file:PR.DevX UX Expert
Single-app top-level form kept first-class (no double-deprecation drama).
apps[].idauto-derived fromowner(escape hatch for same-owner collisions). Error messages name the offending input and the next action. Three-form documentation block lands in the HTML doc-comment AND indocs/src/content/docs/enterprise/.repositories: "*"gotcha documented inline.Supply Chain Security Expert
dependencies.github-appform (least privilege per credential group by construction).echo $matrix/echo $groupsinapm-prep.apm-actionbundles-file:PR must specify (a) path validation within workspace, (b) per-tarball path validation, (c)path_securityguards on extraction, (d) deterministic conflict resolution with refusal or a::warning::on collision. shared/apm.md does not merge until that contract is written.Auth Expert
Not activated -- design touches workflow-level token minting only (
actions/create-github-app-token+ matrix). No fast-path file insrc/apm_cli/core/is touched; AuthResolver, host classification, and HTTP authorization headers are unchanged.OSS Growth Hacker
Side-channel to CEO: this unblocks the enterprise platform-engineering audience (orgs with multiple internal package repos behind separate App installations) -- the Lorenzo-Storelli-style usage. Story angle: "the package manager that respects your org boundaries." Three-forms block doubles as docs/enterprise example. No
WIP/growth-strategy.mdchange mid-design; insight to be appended after ship.CEO arbitration
Specialists are aligned. UX provided the most aggressive revisions, the architects adopted them in iteration 3, security added one hard prerequisite (upstream
apm-actioncontract), and logging captured two upstream requirements. No specialist disagreed with another, so no arbitration was needed beyond ratifying the two-PR sequencing:microsoft/apm-actiongainsbundles-file:input. Contract spec written first per S6.shared/apm.mdv3 inmicrosoft/apm, pinning the newapm-actionversion. Closes shared/apm.md: support multiple GitHub Apps per workflow for multi-org private packages #983.Position as additive multi-org support, not a deprecation of #982. CHANGELOG line:
shared/apm.md: cross-org private packages via apps[] (multiple GitHub App installations per workflow).Required actions before merge
microsoft/apm-actionPR addingbundles-file:input with the security contract from S6 (path validation, extraction guards, deterministic conflict resolution).apm-actionrelease; pin it in PR-B.<NEW_VERSION>placeholders in the workflow shape above.docs/src/content/docs/enterprise/(private packages section) with the three-forms block.[Unreleased].echomatrix/groups variables inapm-prep(S3 mitigation).Optional follow-ups
gh-aw/.github/workflows/shared/apm.md(per-group cache key + lock-file hash) in a separate PR.apm-actionaccumulates 3+ multi-bundle quirks, extract amicrosoft/apm-awcomposite action wrapping the matrix machinery.WIP/growth-strategy.mdafter the change ships.Validation evidence
import-schemaarray-of-objects support:pkg/parser/import_field_extractor.go:603-722(validateImportInputType->validateObjectInput).pkg/parser/import_field_extractor.go:798-812(substituteImportInputsInContent).pkg/parser/import_field_extractor.go:360-363.actions/create-github-app-token@v3.1.1pinned ingh-aw/pkg/workflow/action_pins.json(sha1b10c78c7865c340bc4f6099eb2f838309f1e8c3).feat(shared/apm): apps[] + matrix fan-out for multi-org App auth
Harden pr-description-skill mermaid conventions (#984)
github-actions commentedon Apr 27, 2026
Triage decision
needs-design
Proposed labels
Milestone
null
Suggested next action
Draft a design doc that (a) validates gh-aw input schema support for arrays-of-objects, (b) specifies bundle merge semantics and lockfile provenance across N pack runs, and (c) selects one of the three proposed approaches; link it back here before any PR opens.
Suggested issue comment
Per-lens notes (collapsed)
DevX UX Expert -- User-Need Reviewer
The request maps to a real user task: consuming private packages from multiple orgs in a single agent workflow. The hypothetical
apps:input syntax is ergonomically clean and mirrors the npm workspaces mental model. The "one workflow per source org" workaround works but breaks workflow composition -- a valid DX concern. The composite-action option (approach 2) would preserve the cleanest user-facing API if gh-aw input constraints allow it.Supply Chain Security Expert -- Risk-Surface Reviewer
Multi-app token minting is the correct least-privilege pattern: one installation token per org rather than one broad cross-org token. The design must explicitly address bundle merge integrity: when two pack runs produce artifacts that are merged, the lockfile must record which packages came from which org and via which App installation. Without this, a compromised org-B package could shadow an expected org-A package in the merged bundle without a visible audit trail.
OSS Growth Hacker -- Contributor-Tone Reviewer
Not activated -- danielmeppiel is the project maintainer/admin. No first-time-contributor tone adjustment needed. The reply should be direct and design-focused.
Python Architect -- Architecture Reviewer
The two structural blockers (job name collision in gh-aw import resolver; single-owner token minting) are correctly diagnosed. Approach 1 (matrix-strategy) is architecturally cleanest for parallel token minting but requires a merge step. Approach 2 (composite action) is the cleanest user surface but needs gh-aw array-of-objects input validation first -- this is the design gate for the most ergonomic path. Approach 3 (documented split) is the zero-complexity option. Recommend validating gh-aw schema constraints before committing to approach 2. Must be status/needs-design until the schema validation is done.
Doc Writer -- Documentation Reviewer
Whichever approach is chosen, the docs gate is a multi-org private package guide in
docs/src/content/docs/guides/covering the supported pattern end-to-end. If approach 3 (documented split) is chosen, that guide IS the feature.area/docs-siteadded as secondary label to remind the implementing PR. The issue itself is clearly written and well-referenced; no clarification needed from the author.APM CEO -- Triage Arbiter
Accept-in-principle, needs-design before code. The multi-org private package case is part of APM's portability story and will matter as enterprise adoption grows. The gh-aw schema constraint is the critical unknown: if arrays-of-objects are not supported, only approaches 1 and 3 are on the table. The design doc gates the PR; no milestone until the design is settled. Lockfile provenance across merged bundles is non-negotiable in the design (Supply Chain Security Expert finding).
feat(shared/apm): apps[] + matrix fan-out for multi-org App auth (#982)
Harden pr-description-skill mermaid conventions (#984)
feat(shared/apm): apps[] + matrix fan-out for multi-org App auth (#982)