Skip to content

shared/apm.md: support multiple GitHub Apps per workflow for multi-org private packages #983

@danielmeppiel

Description

@danielmeppiel

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:

  1. 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.
  2. actions/create-github-app-token is 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-package

Workarounds available today

  • One workflow per source org, each importing shared/apm.md with its own credentials. Works, but splits the agent run.
  • One GitHub App installed in every source org (single app-id/private-key shared across orgs). Still requires a separate owner per token mint, so multiple mint steps in a forked shared/apm.md.
  • Fork shared/apm.md locally to chain N create-github-app-token + N apm-action pack steps against the same workspace. Tractable for 2-3 orgs, ugly beyond.

Design constraints

  • gh-aw import-schema documents that object inputs 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-action may be required.
  • Bundle merging across multiple pack runs needs to be defined (sequential append vs. separate artifacts).

Possible designs (non-exhaustive)

  1. 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.
  2. Composite action wrapper — a new action that takes a structured apps: input, mints tokens, and invokes microsoft/apm-action once per group.
  3. 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

No one assigned

    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.enhancementDeprecated: use type/feature. Kept for issue history; will be removed in milestone 0.10.0.status/needs-designDirection approved, design discussion required before code.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).theme/portabilityOne manifest, every target. Multi-target deploy, marketplace, packaging, install.type/featureNew capability, new flag, new primitive.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions