Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Symlink resolution gaps allow local actions to bypass nested-checkout safeguards, permitting incorrect $/ rewrites and unintended modifications inside nested checkouts.
2 open issues
What changed in this PR
This PR limits --migrate-local-actions to the current checkout, addressing unintended migration of files in nested worktrees, submodules, and clones described in #253.
Changes:
- Skips nested checkouts during action-file discovery.
- Leaves local references into nested checkouts unchanged.
- Adds regression tests while preserving migration when an explicit repository root sits above the checkout.
| File | Description |
|---|---|
internal/workflowfile/workflowfile.go |
Adds checkout detection and nested-checkout filtering during discovery. |
internal/workflowfile/workflowfile_test.go |
Tests nested-checkout exclusion and root-handling edge cases. |
internal/workflowfile/rewrite.go |
Excludes nested-checkout actions from local-reference migration. |
cmd/gh-actions-lock/migrate_test.go |
Tests migration with an explicit root above the checkout. |
Review effort: Balanced (auto)
filepath.EvalSymlinks doesn't resolve junctions, so a junction pointing into a submodule slipped past inNestedCheckout and the action was migrated to `$/`. Any non-directory on the resolved path now counts as nested. This also leaves a junction that stays inside the checkout unmigrated, which is the safe side. Tests that create symlinks now skip on Windows when the privilege is missing, and fail elsewhere as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
@jessehouwing I made a stab at Windows, but I don't have a machine to test on, and Windows test don't run as part of CI here. I don't think I should add Windows CI runners here either. EDIT: I see you have something incoming in #259 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

--migrate-local-actionsswept action files in every checkout below the repo root, including nested worktrees (e.g..gwt/<name>/), submodules and nested clones. It rewrote files that aren't part of this repository and could fail the whole run because of them..gitfile (worktree, submodule) or a.gitdirectory (nested clone)../…ref that points into a nested checkout is no longer treated as a same-repo action, so it stays./instead of being rewritten to a$/…ref that can't reach it.GH_ACTIONS_LOCK_REPO_ROOTpoints at a directory without.gitthat holds the real checkout below it (as with actions/checkoutpath: src), nothing is skipped, so that checkout is still migrated..gitin that listing, so the check adds no extra syscall per directory.Fixes #253
🤖 Generated with Claude Code