Skip to content

docs: document inlined-imports: true for cross-org workflow_call scenarios#24977

Merged
pelikhan merged 2 commits intomainfrom
copilot/implement-inline-imports-flag
Apr 6, 2026
Merged

docs: document inlined-imports: true for cross-org workflow_call scenarios#24977
pelikhan merged 2 commits intomainfrom
copilot/implement-inline-imports-flag

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 6, 2026

Cross-org workflow_call fails at activation because the caller's GITHUB_TOKEN cannot check out a platform repo in a different organization. The inlined-imports: true frontmatter flag already solves this (embeds all imports into the lock file at compile time, eliminating the cross-org checkout), but was undocumented for this use case.

Changes

  • reference/imports.md — Renamed section to "Self-Contained Lock Files" and restructured around two use cases: cross-org workflow_call (new, primary) and repository rulesets (existing). Added trade-off note: larger lock file vs. no cross-org token requirement.

  • patterns/central-repo-ops.mdx — Fixed stale "How It Works" description (was showing the old github.event_name == 'workflow_call' ternary; now describes the actual resolve-host-repo / GITHUB_WORKFLOW_REF approach). Added "Cross-Organization Setup" section prescribing inlined-imports: true when caller and callee are in different orgs.

  • reference/faq.md — Fixed broken anchor caused by section rename. Added FAQ entry for the cross-org checkout error with fix and link.

Example

# platform-gateway.md — hosted in org-b, called from org-a trigger files
---
on:
  workflow_call:
engine: copilot
inlined-imports: true        # embeds imports at compile time; no cross-org checkout needed
imports:
  - shared/common-tools.md
  - shared/security-setup.md
---

Copilot AI changed the title [WIP] Implement inline-imports frontmatter flag for lock files docs: document inlined-imports: true for cross-org workflow_call scenarios Apr 6, 2026
Copilot AI requested a review from pelikhan April 6, 2026 23:33
@pelikhan pelikhan marked this pull request as ready for review April 6, 2026 23:51
Copilot AI review requested due to automatic review settings April 6, 2026 23:51
@pelikhan pelikhan merged commit 32cf4f0 into main Apr 6, 2026
@pelikhan pelikhan deleted the copilot/implement-inline-imports-flag branch April 6, 2026 23:51
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Documents inlined-imports: true as the recommended fix for cross-organization workflow_call failures caused by runtime import checkout limitations, and updates related docs/anchors accordingly.

Changes:

  • Restructures imports reference to emphasize “Self-Contained Lock Files” and adds a cross-org workflow_call use case + trade-offs.
  • Updates the central repo ops pattern to describe the current cross-repo checkout mechanism and adds cross-organization guidance.
  • Fixes a broken FAQ anchor and adds a new FAQ entry covering the cross-org checkout error and resolution.
Show a summary per file
File Description
docs/src/content/docs/reference/imports.md Renames/reframes the inlined-imports: true docs around self-contained lock files and adds cross-org workflow_call guidance.
docs/src/content/docs/reference/faq.md Updates the renamed-section anchor and adds an FAQ entry for cross-org checkout failures.
docs/src/content/docs/patterns/central-repo-ops.mdx Refreshes “How It Works” and adds a cross-organization setup section recommending inlined-imports: true.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 3/3 changed files
  • Comments generated: 1

Comment on lines +416 to +422
The setup above works when the caller and callee repositories are in the **same organization** (the `GITHUB_TOKEN` can access internal repos within the org). When the platform repo is in a **different organization**, the caller's `GITHUB_TOKEN` cannot check out the platform repo's files, producing an error such as:

```
fatal: repository 'https://github.com/other-org/platform-repo/' not found
```

This ensures the activation job checks out the **platform repo's** `.github` folder — where the workflow markdown and runtime imports live — regardless of which application repo triggered the workflow. For non-`workflow_call` events, the expression falls back to the current repository.
Use `inlined-imports: true` on the platform workflow to make the lock file self-contained. All imported content is embedded into the `.lock.yml` at compile time and no cross-organization checkout is needed at runtime:
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Cross-Organization Setup section states that when the platform repo is in a different organization the caller’s GITHUB_TOKEN cannot check out the platform repo’s files. That failure is specifically for private (or otherwise not publicly readable) repos; a public platform repo is still checkoutable cross-org. Consider qualifying the text (e.g., “different organization and the platform repo is private/not accessible to the caller”) to avoid implying cross-org is always broken.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plan] Implement/document inline-imports frontmatter flag for self-contained cross-org lock files

3 participants