Fix nested reusable workflows#5888
Conversation
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
ChristopherHX
left a comment
There was a problem hiding this comment.
I believe this still need fine tuning see comments.
|
|
||
| runner := &runnerImpl{ | ||
| config: rc.Config, | ||
| config: &configCopy, |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
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