@@ -15,7 +15,11 @@ export class LocalActionsManager {
1515 }
1616
1717 await mkdir ( path . dirname ( destinationPath ) , { recursive : true } ) ;
18- await symlink ( sourceDirectory , destinationPath , this . #getSymlinkType( ) ) ;
18+ const symlinkTarget = this . #resolveSymlinkTarget(
19+ sourceDirectory ,
20+ destinationPath ,
21+ ) ;
22+ await symlink ( symlinkTarget , destinationPath , this . #getSymlinkType( ) ) ;
1923
2024 return {
2125 created : true ,
@@ -29,6 +33,7 @@ export class LocalActionsManager {
2933 }
3034
3135 await rm ( destinationPath , { force : true , recursive : true } ) ;
36+
3237 return true ;
3338 }
3439
@@ -37,8 +42,7 @@ export class LocalActionsManager {
3742 throw new Error ( "Workspace path is required." ) ;
3843 }
3944
40- const normalizedWorkspacePath = path . resolve ( workspacePath ) ;
41- return path . resolve ( normalizedWorkspacePath , "../self-actions" ) ;
45+ return path . resolve ( workspacePath , "../self-actions" ) ;
4246 }
4347
4448 async resolveSourceDirectory ( { sourcePath } ) {
@@ -74,4 +78,18 @@ export class LocalActionsManager {
7478 #getSymlinkType( ) {
7579 return process . platform === "win32" ? "junction" : "dir" ;
7680 }
81+
82+ /**
83+ * Computes the symlink target. Uses a relative path on non-Windows
84+ * platforms so the symlink resolves correctly from both the container
85+ * filesystem and the host filesystem (bind-mount path differs).
86+ * Windows junctions require absolute targets.
87+ */
88+ #resolveSymlinkTarget( sourceDirectory , destinationPath ) {
89+ if ( this . #getSymlinkType( ) === "junction" ) {
90+ return sourceDirectory ;
91+ }
92+
93+ return path . relative ( path . dirname ( destinationPath ) , sourceDirectory ) ;
94+ }
7795}
0 commit comments