Skip to content

fix: resolve local actions inside remote composites#83

Merged
joshjohanning merged 2 commits into
joshjohanning:mainfrom
Wuodan:upstream-PR/01-Fix-Remote-Composite-Local-Path-Resolution
May 14, 2026
Merged

fix: resolve local actions inside remote composites#83
joshjohanning merged 2 commits into
joshjohanning:mainfrom
Wuodan:upstream-PR/01-Fix-Remote-Composite-Local-Path-Resolution

Conversation

@Wuodan

@Wuodan Wuodan commented May 10, 2026

Copy link
Copy Markdown
Contributor

I think the merge of last PR #81 left a small gap: local paths in remote actions.
This PR fixes it.

I try to explain the scenario below.


Remote Composite Local Path Resolution

The real-world scenario is this:

  1. A workflow uses a remote composite action that lives in a subdirectory of another repository.

Example:

- uses: some-owner/some-repo/composite-actions/parent@v1
  1. In that repository, the referenced action lives at:
composite-actions/parent/action.yml
  1. The scanner loads that file because owner/repo/path@ref means "fetch path/action.yml from that repository at that ref".

  2. Inside that composite action, one of its steps uses another local action via a relative path:

runs:
  using: composite
  steps:
    - uses: ./child
  1. That means the composite action is delegating to another action located next to it:
composite-actions/parent/child/action.yml

So the chain is:

  • workflow references some-owner/some-repo/composite-actions/parent@v1
  • scanner resolves that to composite-actions/parent/action.yml
  • inside that file it sees uses: ./child
  • scanner should then resolve that to composite-actions/parent/child/action.yml

The key point is how GitHub treats ./child here.

At first glance, it is easy to ask whether ./child should be relative to the repository root. For composite actions, GitHub's docs point the other way: local uses: ./... references are relative to the composite action's own directory.

Relevant GitHub docs:

Applied to this scenario, ./child inside:

composite-actions/parent/action.yml

should resolve relative to composite-actions/parent/, so the correct target is:

composite-actions/parent/child/action.yml

not:

child/action.yml

That is the bug fixed here: upstream currently resolves ./child as if it were repository-root-relative, but for composite actions it needs to be resolved relative to the directory of the composite action currently being expanded.

@Wuodan

Wuodan commented May 10, 2026

Copy link
Copy Markdown
Contributor Author

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes remote composite expansion so local uses: ./... references are resolved relative to the composite action’s directory (instead of the remote repo root), matching GitHub composite-action behavior.

Changes:

  • Resolve nested ./... paths in remote composite actions by joining against the parent composite’s actionPath.
  • Update Jest coverage to reflect composite-directory-relative resolution for remote composites.
Show a summary per file
File Description
src/index.js Adjusts remote composite nested local-path resolution to be relative to the composite action directory.
__tests__/index.test.js Updates the remote composite path-resolution test and expected fetched path accordingly.

Copilot's findings

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

Comment thread src/index.js
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@joshjohanning

Copy link
Copy Markdown
Owner

Great PR! Thanks for the fix ⚒️ @Wuodan

@joshjohanning joshjohanning merged commit 2484a53 into joshjohanning:main May 14, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

📦 Draft Release Created

A draft release v2.5.4 has been created for this PR.

🔗 View Draft Release

Next Steps

  • Review the release notes
  • Publish the release to make it permanent

This is an automated reminder from the publish-github-action workflow.

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.

3 participants