Skip to content

Conversation

lfallon-manifest
Copy link

When a reusable workflow calls another local workflow using relative paths (uses: ./.github/workflows/...), act was incorrectly looking for the nested workflow in the caller's repository instead of the reusable workflow's repository.

This fix ensures that local workflow references are resolved relative to the reusable workflow's location by passing the correct working directory to the reusable workflow runner.

Fixes #1875

When a reusable workflow calls another local workflow using relative paths
(uses: ./.github/workflows/...), act was incorrectly looking for the nested
workflow in the caller's repository instead of the reusable workflow's repository.

This fix ensures that local workflow references are resolved relative to the
reusable workflow's location by passing the correct working directory to the
reusable workflow runner.

Fixes nektos#1875
Copy link
Contributor

@ChristopherHX ChristopherHX left a comment

Choose a reason for hiding this comment

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

I believe this still need fine tuning see comments.

runner := &runnerImpl{
config: rc.Config,
config: &configCopy,
Copy link
Contributor

Choose a reason for hiding this comment

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

Isn't (local) checkout now broken? (the actions/checkout stub)
i.e. clones the reusable workflow repository instead of local workdir (the local workdir is expected for me as clone source).

runner, err := NewReusableWorkflowRunner(rc)
// Use the action cache directory path for the workdir
workflowDir := fmt.Sprintf("%s/%s", rc.ActionCacheDir(), safeFilename(filename))
runner, err := NewReusableWorkflowRunner(rc, workflowDir)
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is broken due to workflowDir not being present for feature flag --use-new-action-cache (flag might be different) and --local-repository.

Due to time consuming CI only the default old action cache is tested here and the new action cache is behind a feature flag.

Copy link

codecov bot commented Jul 31, 2025

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 74.89%. Comparing base (bd4bc99) to head (14a79d5).
⚠️ Report is 20 commits behind head on master.

Files with missing lines Patch % Lines
pkg/runner/reusable_workflow.go 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5888      +/-   ##
==========================================
+ Coverage   74.65%   74.89%   +0.23%     
==========================================
  Files          73       73              
  Lines       11139    11195      +56     
==========================================
+ Hits         8316     8384      +68     
+ Misses       2186     2177       -9     
+ Partials      637      634       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling reusable workflow which uses a subworkflow at a relative path in the same repository fails with file not found.
2 participants