-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Fix nested reusable workflows #5888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
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
There was a problem hiding this 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, |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
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