--migrate-local-actions rewrites action files in nested worktrees and submodules
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 20/100
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.gitfile - submodules, which also have a
.gitfile - nested clones, which have their own
.gitdirectory
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
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from github/gh-actions-lock
-
Fix mode unpins a reusable workflow call when the same repository is also used as a step actionPossibly taken @suzuki-shunsuke claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
github/gh-actions-lock#261 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
github/gh-actions-lock#264 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 Half a day Newbie friendliness 42/100
github/gh-actions-lock#262 ·
Maintainers usually reply within 1 day
-
Dependabot drops an unchanged transitive dependency when bumping a composite actionPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 30/100
github/gh-actions-lock#257 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
github/gh-actions-lock#252 ·
Maintainers usually reply within 1 day
All issues in github/gh-actions-lock
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
riverqueue/river#1576 ·
Maintainers usually reply within 1 day
-
NFS StorageProvider renders a missing nfsSubDir as "<no value>"Possibly taken @ldming claimed this today. Openkind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
apecloud/kubeblocks#11067 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
emersion/go-msgauth#87 ·
-
CLI: `describe <ns>.<table>` reports "namespace does not exist" when only the table is missingPossibly taken @Shruthirdy claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
apache/iceberg-go#2423 ·
Maintainers usually reply within 2 days
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
mafzalkalwardev/mailforge#21 ·