mirror of
https://github.com/actions/runner-container-hooks.git
synced 2025-12-15 09:16:44 +00:00
fixed substring issue with /github/workspace and /github/file_commands (#35)
* fixed substring issue with /github/workspace and /github/file_commands * npm run format * last 3 parts of the path are mounted to /github/workspace and /github/file_commands * file commands now point to _temp/_runner_file_commands
This commit is contained in:
@@ -22,16 +22,18 @@ export function containerVolumes(
|
||||
|
||||
const workspacePath = process.env.GITHUB_WORKSPACE as string
|
||||
if (containerAction) {
|
||||
const i = workspacePath.lastIndexOf('_work/')
|
||||
const workspaceRelativePath = workspacePath.slice(i + '_work/'.length)
|
||||
mounts.push(
|
||||
{
|
||||
name: POD_VOLUME_NAME,
|
||||
mountPath: '/github/workspace',
|
||||
subPath: workspacePath.substring(workspacePath.indexOf('work/') + 1)
|
||||
subPath: workspaceRelativePath
|
||||
},
|
||||
{
|
||||
name: POD_VOLUME_NAME,
|
||||
mountPath: '/github/file_commands',
|
||||
subPath: workspacePath.substring(workspacePath.indexOf('work/') + 1)
|
||||
subPath: '_temp/_runner_file_commands'
|
||||
}
|
||||
)
|
||||
return mounts
|
||||
|
||||
Reference in New Issue
Block a user