[PR #5980] fix: chained reusable workflows #2644

Open
opened 2026-03-01 22:37:34 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/nektos/act/pull/5980
Author: @pablots99
Created: 12/17/2025
Status: 🔄 Open

Base: masterHead: fix/chained-reusable-workflows


📝 Commits (3)

  • b39ec15 Fix chained reusable workflows
  • ae1d83a Merge branch 'master' into fix/chained-reusable-workflows
  • 173e6cc Merge branch 'master' into fix/chained-reusable-workflows

📊 Changes

3 files changed (+139 additions, -11 deletions)

View changed files

📝 pkg/runner/reusable_workflow.go (+39 -10)
pkg/runner/reusable_workflow_test.go (+98 -0)
📝 pkg/runner/runner.go (+2 -1)

📄 Description

Problem

When a local workflow calls a reusable workflow from an external repository, and that external workflow calls another reusable workflow from the same external repo using a local reference (./.github/workflows/...), act fails with a "file not found" error.

Local Repo
│
│  uses: org/shared-workflows/.github/workflows/app-ci.yml@main
│
└──► External Repo: app-ci.yml
     │
     │  uses: ./.github/workflows/setup.yml  ← FAILS
     │
     └──► External Repo: setup.yml (not found)

Error: stat /path/to/local/repo/.github/workflows/setup.yml: no such file or directory

The nested workflow reference resolves relative to the local repository instead of the external repository.

Solution

Track the parent workflow's origin through the runner chain. When executing a reusable workflow from an external repo, store a reference to that workflow in the caller struct. When a nested workflow uses a local reference, check if we're inside a remote workflow and resolve the path accordingly.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/nektos/act/pull/5980 **Author:** [@pablots99](https://github.com/pablots99) **Created:** 12/17/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `fix/chained-reusable-workflows` --- ### 📝 Commits (3) - [`b39ec15`](https://github.com/nektos/act/commit/b39ec15f7e4cf2378e99562dfabc30de7a99fda1) Fix chained reusable workflows - [`ae1d83a`](https://github.com/nektos/act/commit/ae1d83a91a8f84b4838ec238aaee929345cbc649) Merge branch 'master' into fix/chained-reusable-workflows - [`173e6cc`](https://github.com/nektos/act/commit/173e6cc1bce86a891a0999aa0b521311b9e1e132) Merge branch 'master' into fix/chained-reusable-workflows ### 📊 Changes **3 files changed** (+139 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `pkg/runner/reusable_workflow.go` (+39 -10) ➕ `pkg/runner/reusable_workflow_test.go` (+98 -0) 📝 `pkg/runner/runner.go` (+2 -1) </details> ### 📄 Description ## Problem When a local workflow calls a reusable workflow from an external repository, and that external workflow calls another reusable workflow from the same external repo using a local reference (`./.github/workflows/...`), `act` fails with a "file not found" error. ``` Local Repo │ │ uses: org/shared-workflows/.github/workflows/app-ci.yml@main │ └──► External Repo: app-ci.yml │ │ uses: ./.github/workflows/setup.yml ← FAILS │ └──► External Repo: setup.yml (not found) ``` Error: `stat /path/to/local/repo/.github/workflows/setup.yml: no such file or directory` The nested workflow reference resolves relative to the local repository instead of the external repository. ## Solution Track the parent workflow's origin through the runner chain. When executing a reusable workflow from an external repo, store a reference to that workflow in the `caller` struct. When a nested workflow uses a local reference, check if we're inside a remote workflow and resolve the path accordingly. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/act#2644
No description provided.