3
0
Fork 0
mirror of https://code.forgejo.org/actions/checkout.git synced 2026-05-28 06:56:28 +00:00
This commit is contained in:
Xavier Solé Nogués 2026-05-27 01:20:25 +08:00 committed by GitHub
commit 3a82fc4566
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11 additions and 1 deletions

3
dist/index.js vendored
View file

@ -2001,7 +2001,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?