Skip to content

fix(actions): clone action runs without hardlinks - #3

Merged
Patel230 merged 1 commit into
mainfrom
fix/action-clone-hardlink-race
Sep 29, 2026
Merged

Patel230 merged 1 commit into
mainfrom
fix/action-clone-hardlink-race

Conversation

@Patel230

Copy link
Copy Markdown
Contributor

race is red on main:

TempDir RemoveAll cleanup: unlinkat .../action-work/1/src/.git: directory not empty

executeActionRun clones with git clone --local, which hardlinks objects into the run directory. The deferred os.RemoveAll(runDir) races the git process, and the test's TempDir cleanup loses.

pull_requests.go:535 already uses --no-hardlinks. This applies the same flag to the action path.

Full go test -race ./... green locally, vet and gofmt clean.

`race` failed on main with:

  TempDir RemoveAll cleanup: unlinkat .../action-work/1/src/.git: directory not empty

`executeActionRun` clones the source with `git clone --local`, which
hardlinks objects from the repository into the run directory. The deferred
`os.RemoveAll(runDir)` then races the git process that may still be writing,
and the test's TempDir cleanup loses.

`pull_requests.go:535` already clones with `--no-hardlinks`; the action path
was missed. Adding the same flag.

Reproduces as an intermittent failure — 13 clean runs locally before the fix
were possible — so the value here is removing the race, not a red-to-green flip.
@Patel230
Patel230 merged commit 2badf3c into main Sep 29, 2026
5 checks passed
@Patel230
Patel230 deleted the fix/action-clone-hardlink-race branch September 29, 2026 18:12
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.

1 participant