Skip to content

Commit fb7a83b

Browse files
mydeaclaude
andcommitted
fix(ci): Fix Docker-in-Docker path mapping and HOME override
When running inside a GHA container, paths resolve to /__w/... which only exists inside the container. Docker-in-Docker volume mounts need host paths (/home/runner/work/...). Convert paths in registrySetup.ts. Also move HOME=/root to docker -e flag since GHA overrides container env settings with its own HOME=/github/home. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 3b3f9dd commit fb7a83b

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

dev-packages/e2e-tests/registrySetup.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ import * as path from 'path';
44
import { PUBLISH_PACKAGES_DOCKER_IMAGE_NAME, TEST_REGISTRY_CONTAINER_NAME, VERDACCIO_VERSION } from './lib/constants';
55

66
const publishScriptNodeVersion = process.env.E2E_TEST_PUBLISH_SCRIPT_NODE_VERSION;
7-
const repositoryRoot = path.resolve(__dirname, '../..');
7+
8+
// When running inside a GHA container, paths resolve to /__w/... which only
9+
// exists inside the container. Docker-in-Docker mounts need host paths.
10+
// The host maps /home/runner/work to /__w, so we convert back.
11+
function toHostPath(p: string): string {
12+
return p.replace(/^\/__w\//, '/home/runner/work/');
13+
}
14+
15+
const repositoryRoot = toHostPath(path.resolve(__dirname, '../..'));
816

917
// https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#grouping-log-lines
1018
function groupCIOutput(groupTitle: string, fn: () => void): void {
@@ -35,7 +43,7 @@ export function registrySetup(): void {
3543
'-p',
3644
'4873:4873',
3745
'-v',
38-
`${__dirname}/verdaccio-config:/verdaccio/conf`,
46+
`${toHostPath(__dirname)}/verdaccio-config:/verdaccio/conf`,
3947
`verdaccio/verdaccio:${VERDACCIO_VERSION}`,
4048
],
4149
{ encoding: 'utf8', stdio: 'inherit' },

0 commit comments

Comments
 (0)