Skip to content

Fix actions to run from project subpath instead of worktree root#7

Merged
wesbillman merged 1 commit intomainfrom
sub-folder-actions
Feb 6, 2026
Merged

Fix actions to run from project subpath instead of worktree root#7
wesbillman merged 1 commit intomainfrom
sub-folder-actions

Conversation

@wesbillman
Copy link
Collaborator

Summary

Fixes branch actions (both prerun and manual) to execute from the correct working directory when a project is configured with a subpath, ensuring build tools like just can find their configuration files.

Changes

  • Resolves the effective working directory by combining the worktree path with the project's subpath before executing actions, rather than always running from the worktree root
  • Applies the fix consistently to both prerun actions (automatic) and manually-triggered branch actions

Context

When a project lives in a subdirectory of a repository (e.g., a monorepo), actions were previously executed from the worktree root. This meant tools like just couldn't locate their justfile because they were running one or more directories above where the build files actually live. Now actions use get_branch_working_dir, which already knows how to resolve the full path including any configured project subpath.

When a project has a subpath configured (e.g., builderbot/staged),
actions like justfile commands were running from the worktree root
instead of the subfolder where the justfile actually lives.

Both run_branch_action and run_prerun_actions now use
get_branch_working_dir() to resolve the effective working directory
(worktree + project subpath), consistent with how AI sessions and
notes already handle this.
@wesbillman wesbillman requested a review from baxen as a code owner February 6, 2026 23:29
@wesbillman wesbillman merged commit b80648f into main Feb 6, 2026
2 checks passed
@wesbillman wesbillman deleted the sub-folder-actions branch February 6, 2026 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants