mirror of
https://github.com/actions/checkout.git
synced 2025-09-14 03:32:20 +08:00
Implement allow-path-outside-workspace
This commit is contained in:
3
dist/index.js
vendored
3
dist/index.js
vendored
@@ -1737,7 +1737,8 @@ function getInputs() {
|
||||
// Repository path
|
||||
result.repositoryPath = core.getInput('path') || '.';
|
||||
result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
|
||||
if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
|
||||
if (!core.getInput('allow-path-outside-workspace') &&
|
||||
!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
|
||||
throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
|
||||
}
|
||||
// Workflow repository?
|
||||
|
Reference in New Issue
Block a user