Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkout Path outside $GITHUB_WORKSPACE #1812

Open
ijas-m opened this issue Jul 6, 2024 · 1 comment
Open

Checkout Path outside $GITHUB_WORKSPACE #1812

ijas-m opened this issue Jul 6, 2024 · 1 comment

Comments

@ijas-m
Copy link

ijas-m commented Jul 6, 2024

Hi,
Please make the checkout to use path outside the $GITHUB_WORKSPACE.

Currently there is an issue when using:
Error: Repository path '<path_outside>' is not under '<$GITHUB_WORKSPACE>'

This is required since repo the $GITHUB_WORKSPACE might be very long for some build tools in Windows.
Without this path, we have to copy everything to new path from $GITHUB_WORKSPACE, which is wasting time and resources.

@MH-ZShearer
Copy link

I was wondering why this wasn't currently supported. I didn't see any reasoning for it listed anywhere. The directory has to be put into a temp directory, which we are currently preferring ZZZ/<RepoName> and then has to be moved to ../<RepoName>, but as mentioned, this wastes time and only pollutes our already busy actions.

Is this check necessary?

// Repository path
result.repositoryPath = core.getInput('path') || '.'
result.repositoryPath = path.resolve(
githubWorkspacePath,
result.repositoryPath
)
if (
!(result.repositoryPath + path.sep).startsWith(
githubWorkspacePath + path.sep
)
) {
throw new Error(
`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`
)
}

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

No branches or pull requests

2 participants