Skip to content

Nested local path imports in remote workflows should resolve #15982

@strawgate

Description

@strawgate

When a workflow is added via gh aw add owner/repo/path/to/workflow.md, the top-level remote import resolves correctly. However, if the imported file itself has relative imports (e.g., shared/tools.md), those are resolved against the local .github/workflows/ directory instead of the remote repo they came from.

Repro:

mkdir test && cd test && git init && mkdir -p .github/workflows
gh aw add elastic/ai-github-actions/gh-agent-workflows/mention-in-pr.md
gh aw compile

Error:

import file not found

Debug output (DEBUG=parser:remote_fetch):

Resolving include path: file_path=elastic/ai-github-actions/.../rwxp.md@..., base_dir=.../.github/workflows
Detected workflowspec format: ...
Using cached import: ... (SHA: ...)           ← top-level remote import succeeds
Resolving include path: file_path=shared/elastic-tools.md, base_dir=.../.github/workflows
Using local file resolution for: shared/elastic-tools.md
Local file not found: .../.github/workflows/shared/elastic-tools.md   ← nested import fails

Expected: Nested relative imports from a remote file should resolve relative to the remote repo (e.g., shared/elastic-tools.md inside elastic/ai-github-actions/.../rwxp.md should resolve to elastic/ai-github-actions/gh-agent-workflows/shared/elastic-tools.md@same-ref).

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions