--migrate-local-actions rewrites action files in nested worktrees and submodules

Open
#253 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@aksestok is already working on this.

Since Nov 2, 2026.

  • #254 by @aksestok — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
20/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
github-actions, go
Domain
cli

Research direction

The --migrate-local-actions sweep walks every action.yml / action.yaml under the repo and only stops at directories named .git. Pull request #254 and the dont-worktrees-or-submodules branch already cover this, so read that work before starting anything new. Done means the sweep skips any subdirectory below the root that has a .git file or directory, and a ./ ref inside such a checkout is left unchanged.

Written by the indexing model from the issue text.

Description

--migrate-local-actions sweeps the whole repository for action.yml / action.yaml files and rewrites their ./… steps to $/…. The sweep only stops at directories named .git, so it also walks into separate checkouts nested inside the repo:

  • git worktrees kept under the repo (e.g. .gwt/<name>/), which have a .git file
  • submodules, which also have a .git file
  • nested clones, which have their own .git directory

Why this is a problem

It edits files that aren't part of the change. A nested worktree is usually another branch someone is working on. After a run in the main checkout, that worktree has uncommitted rewrites the user never asked for, and these files are included in the run's migration count. For a submodule or nested clone, the files belong to a different repository entirely, so the edits can't be committed as part of this repo's change.

An unrelated checkout can stop the run. Migration is all-or-nothing. If any action file in a nested checkout fails migration validation, the whole run fails with refusing to migrate … and rolls back, even though nothing in this repository is wrong.

./ refs into a submodule get the wrong rewrite. A ./path ref is rewritten to $/path when an action file exists at that path on disk. If the path is inside a submodule, the file is on disk but isn't part of this repository's tree, so the $/path ref can't reach it. The ./ ref should be left alone.

Repro

cd my-repo                       # has .github/workflows/*.yml
git worktree add .gwt/other some-branch
# .gwt/other/.github/actions/foo/action.yml has `uses: ./something`
gh actions-lock --migrate-local-actions
git -C .gwt/other status         # foo/action.yml now modified: ./something -> $/something

Expected

The sweep covers only this repository's checkout. It skips any subdirectory below the root that is its own checkout (has a .git file or directory), and it never treats a ./ path inside such a checkout as a same-repo action.

A fix is in progress on the dont-worktrees-or-submodules branch; a PR will follow.

Dominant language
Go
Stars
253
Forks
15
Avg merge
19h 30m
Merged PRs (30d)
60

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from github/gh-actions-lock

All issues in github/gh-actions-lock

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.